/*
 * Texte pour dire – Design
 * Fond crème, titres en serif, accent terracotta, cartes arrondies, mode sombre automatique.
 * Tout est limité à body.tpd-design : décocher l’option dans les réglages retire ce design.
 */

body.tpd-design {
	--tpdd-bg: #faf9f5;
	--tpdd-surface: #ffffff;
	--tpdd-surface-2: #f0eee6;
	--tpdd-text: #141413;
	--tpdd-muted: #66655f;
	--tpdd-border: #e3e0d4;
	--tpdd-clay: #d97757;
	--tpdd-accent: #b85536;
	--tpdd-accent-hover: #a04a2e;
	--tpdd-btn-text: #ffffff;
	--tpdd-serif: "Newsreader", Georgia, "Times New Roman", serif;
	--tpdd-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	/* Thèmes « bloc » (Twenty Twenty-Five, etc.) : on remplace leurs couleurs de base. */
	--wp--preset--color--base: var(--tpdd-bg);
	--wp--preset--color--base-2: var(--tpdd-surface-2);
	--wp--preset--color--contrast: var(--tpdd-text);
	--wp--preset--color--contrast-2: var(--tpdd-muted);
	--wp--preset--color--contrast-3: var(--tpdd-muted);
	--wp--preset--color--accent-1: var(--tpdd-accent);
	--wp--style--global--content-size: 42rem;

	color-scheme: light;
	background: var(--tpdd-bg);
	color: var(--tpdd-text);
	font-family: var(--tpdd-sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
	body.tpd-design.tpd-auto-dark {
		--tpdd-bg: #262624;
		--tpdd-surface: #30302e;
		--tpdd-surface-2: #3a3a37;
		--tpdd-text: #faf9f5;
		--tpdd-muted: #b0aea5;
		--tpdd-border: #45453f;
		--tpdd-accent: #e0866a;
		--tpdd-accent-hover: #eb9a80;
		--tpdd-btn-text: #141413;
		color-scheme: dark;
	}
	body.tpd-design.tpd-auto-dark .tpd-field select option {
		background: #30302e;
		color: #faf9f5;
	}
}

html {
	scroll-behavior: smooth;
}

body.tpd-design ::selection {
	background: rgba(217, 119, 87, 0.3);
}

body.tpd-design :focus-visible {
	outline: 2px solid var(--tpdd-clay);
	outline-offset: 2px;
}

/* ---------- Titres : serif, poids léger ---------- */

body.tpd-design :is(h1, h2, h3, h4, h5, h6),
body.tpd-design .wp-block-post-title,
body.tpd-design .wp-block-heading {
	font-family: var(--tpdd-serif);
	font-weight: 400;
	color: var(--tpdd-text);
	letter-spacing: -0.015em;
	line-height: 1.15;
	text-wrap: balance;
}

body.tpd-design h1,
body.tpd-design .wp-block-post-title,
body.tpd-design .entry-title {
	font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem);
}

body.tpd-design h2 {
	font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.1rem);
}

body.tpd-design h3 {
	font-size: 1.3rem;
	line-height: 1.25;
}

body.tpd-design .wp-block-post-content h2,
body.tpd-design .entry-content h2 {
	margin-top: 2.4em;
	margin-bottom: 0.5em;
}

body.tpd-design .wp-block-post-content h3,
body.tpd-design .entry-content h3 {
	margin-top: 1.6em;
	margin-bottom: 0.3em;
}

body.tpd-design :where(.wp-block-post-content, .entry-content) p {
	line-height: 1.7;
}

/* ---------- Liens ---------- */

body.tpd-design :where(.wp-block-post-content, .entry-content) a {
	color: var(--tpdd-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

body.tpd-design :where(.wp-block-post-content, .entry-content) a:hover {
	color: var(--tpdd-accent-hover);
}

/* ---------- En-tête et navigation ---------- */

body.tpd-design header.wp-block-template-part,
body.tpd-design .site-header,
body.tpd-design #masthead {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--tpdd-bg);
	border-bottom: 1px solid var(--tpdd-border);
}

body.tpd-design.admin-bar header.wp-block-template-part {
	top: 32px;
}

@media (max-width: 782px) {
	body.tpd-design.admin-bar header.wp-block-template-part {
		top: 46px;
	}
}

body.tpd-design .wp-block-site-title,
body.tpd-design .wp-block-site-title a,
body.tpd-design .site-title,
body.tpd-design .site-title a {
	font-family: var(--tpdd-serif);
	font-size: 1.4rem;
	font-weight: 500;
	letter-spacing: -0.01em;
	color: var(--tpdd-text);
	text-decoration: none;
}

body.tpd-design .wp-block-navigation,
body.tpd-design .main-navigation {
	font-family: var(--tpdd-sans);
	font-size: 0.95rem;
	font-weight: 500;
}

body.tpd-design .wp-block-navigation a,
body.tpd-design .main-navigation a {
	color: var(--tpdd-muted);
	text-decoration: none;
	padding: 0.35em 0.7em;
	border-radius: 10px;
	transition: background-color 0.15s, color 0.15s;
}

body.tpd-design .wp-block-navigation a:hover,
body.tpd-design .wp-block-navigation a[aria-current="page"],
body.tpd-design .main-navigation a:hover,
body.tpd-design .main-navigation .current-menu-item > a {
	color: var(--tpdd-text);
	background: var(--tpdd-surface-2);
}

body.tpd-design .wp-block-navigation .wp-block-navigation__submenu-container {
	background: var(--tpdd-surface);
	color: var(--tpdd-text);
	border: 1px solid var(--tpdd-border);
	border-radius: 14px;
	padding: 0.4em;
	box-shadow: 0 12px 32px -12px rgba(20, 20, 19, 0.18);
}

body.tpd-design .wp-block-navigation .wp-block-navigation__submenu-container a {
	color: var(--tpdd-text);
}

body.tpd-design .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--tpdd-bg);
	color: var(--tpdd-text);
}

/* ---------- Pied de page ---------- */

body.tpd-design footer.wp-block-template-part,
body.tpd-design .site-footer {
	border-top: 1px solid var(--tpdd-border);
	color: var(--tpdd-muted);
	font-size: 0.92rem;
}

body.tpd-design footer.wp-block-template-part a,
body.tpd-design .site-footer a {
	color: var(--tpdd-muted);
}

/* ---------- Page d’accueil : titre et introduction centrés ---------- */

body.tpd-design.home .wp-block-post-title,
body.tpd-design.home .entry-title {
	text-align: center;
	margin-top: clamp(1.5rem, 5vw, 3.5rem);
}

body.tpd-design.home .wp-block-post-content > p:first-child,
body.tpd-design.home .entry-content > p:first-child {
	text-align: center;
	font-family: var(--tpdd-serif);
	font-size: 1.25rem;
	line-height: 1.6;
	color: var(--tpdd-muted);
	max-width: 36rem;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Générateur : la carte centrale ---------- */

body.tpd-design .tpd {
	--tpd-accent: var(--tpdd-accent);
	--tpd-accent-text: var(--tpdd-btn-text);
	--tpd-border: var(--tpdd-border);
	--tpd-soft: var(--tpdd-surface-2);
	max-width: none;
	margin: 2rem 0;
	padding: clamp(1.1rem, 3vw, 1.75rem);
	background: var(--tpdd-surface);
	color: var(--tpdd-text);
	border: 1px solid var(--tpdd-border);
	border-radius: 22px;
	box-shadow: 0 1px 2px rgba(20, 20, 19, 0.04), 0 14px 34px -14px rgba(20, 20, 19, 0.14);
	font-family: var(--tpdd-sans);
}

body.tpd-design .tpd .tpd-title {
	margin: 0 0 0.9em;
	font-size: 1.5rem;
}

body.tpd-design .tpd .tpd-field label {
	margin-bottom: 0.35em;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--tpdd-muted);
}

body.tpd-design .tpd .tpd-field select,
body.tpd-design .tpd .tpd-field input[type="text"],
body.tpd-design .tpd .tpd-field textarea {
	padding: 0.7em 0.85em;
	background: var(--tpdd-bg);
	color: var(--tpdd-text);
	border: 1px solid var(--tpdd-border);
	border-radius: 12px;
	font: inherit;
	font-size: 1rem;
	transition: border-color 0.15s, box-shadow 0.15s;
}

body.tpd-design .tpd .tpd-field select:focus,
body.tpd-design .tpd .tpd-field input[type="text"]:focus,
body.tpd-design .tpd .tpd-field textarea:focus {
	outline: none;
	border-color: var(--tpdd-clay);
	box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.28);
}

body.tpd-design .tpd .tpd-btn {
	margin-top: 1.25em;
	padding: 0.85em 1.2em;
	background: var(--tpdd-accent);
	color: var(--tpdd-btn-text);
	border-radius: 12px;
	font-family: var(--tpdd-sans);
	font-size: 1rem;
	font-weight: 500;
	transition: background-color 0.15s;
}

body.tpd-design .tpd .tpd-btn:hover {
	background: var(--tpdd-accent-hover);
	filter: none;
}

body.tpd-design .tpd .tpd-text {
	padding: 1.1em 1.3em;
	background: var(--tpdd-bg);
	border: 1px solid var(--tpdd-border);
	border-radius: 16px;
	font-family: var(--tpdd-serif);
	font-size: 1.15rem;
	line-height: 1.7;
}

body.tpd-design .tpd .tpd-note,
body.tpd-design .tpd .tpd-left {
	color: var(--tpdd-muted);
	opacity: 1;
}

body.tpd-design .tpd-small {
	padding: 0.45em 0.85em;
	background: var(--tpdd-surface);
	color: var(--tpdd-text);
	border: 1px solid var(--tpdd-border);
	border-radius: 10px;
	font-family: var(--tpdd-sans);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s;
}

body.tpd-design .tpd-small:hover {
	background: var(--tpdd-surface-2);
	color: var(--tpdd-text);
}

body.tpd-design .tpd .tpd-related {
	border-top-color: var(--tpdd-border);
}

body.tpd-design .tpd .tpd-related-title {
	font-size: 1.15rem;
}

body.tpd-design .tpd .tpd-related-list a {
	color: var(--tpdd-accent);
}

/* ---------- Occasions : pastilles ---------- */

body.tpd-design .tpd-occasions a {
	padding: 0.5em 1em;
	background: var(--tpdd-surface);
	color: var(--tpdd-text);
	border: 1px solid var(--tpdd-border);
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s, border-color 0.15s;
}

body.tpd-design .tpd-occasions a:hover {
	background: var(--tpdd-surface-2);
	border-color: var(--tpdd-clay);
	color: var(--tpdd-text);
}

/* ---------- Articles : cartes ---------- */

body.tpd-design .tpd-articles-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.tpd-design .tpd-articles-list li {
	margin: 0;
	padding: 1.1rem 1.2rem;
	background: var(--tpdd-surface);
	border: 1px solid var(--tpdd-border);
	border-radius: 16px;
}

body.tpd-design .tpd-articles-list a {
	color: var(--tpdd-text);
	font-family: var(--tpdd-serif);
	font-size: 1.18rem;
	line-height: 1.3;
	text-decoration: none;
}

body.tpd-design .tpd-articles-list a:hover {
	color: var(--tpdd-accent);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

body.tpd-design .tpd-articles-list p {
	margin: 0.5em 0 0;
	font-size: 0.92rem;
	color: var(--tpdd-muted);
	opacity: 1;
}

/* ---------- Exemples de messages (citations) ---------- */

body.tpd-design .wp-block-quote {
	margin: 1em 0;
	padding: 1.1em 1.3em;
	background: var(--tpdd-surface);
	color: var(--tpdd-text);
	border: 1px solid var(--tpdd-border);
	border-radius: 14px;
	font-family: var(--tpdd-serif);
	font-size: 1.12rem;
	line-height: 1.7;
}

body.tpd-design .wp-block-quote p {
	margin: 0;
}

/* ---------- Boutons WordPress, images ---------- */

body.tpd-design .wp-block-button__link,
body.tpd-design .wp-element-button {
	background: var(--tpdd-text);
	color: var(--tpdd-bg);
	border-radius: 12px;
	font-weight: 500;
	text-decoration: none;
}

body.tpd-design .wp-block-post-content img,
body.tpd-design .entry-content img {
	border-radius: 14px;
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	body.tpd-design * {
		transition: none !important;
	}
}
