/*
Theme Name:   TT5 Enfant — Base agence
Theme URI:    https://example.com/
Description:  Thème enfant de Twenty Twenty-Five, réutilisable d'un client à l'autre. Les couleurs, typos et dimensions se règlent dans theme.json ; les modèles de page vont dans /templates, les compositions dans /patterns.
Author:       Mary — Magnetic Way
Template:     twentytwentyfive
Version:      1.4.1
Requires at least: 6.7
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  tt5-enfant-agence
*/

/* =========================================================
   ALIAS DES TOKENS (valeurs définies dans theme.json)
   ========================================================= */
:root {
	--tea-bg: var(--wp--preset--color--base);
	--tea-ink-strong: var(--wp--preset--color--contrast);
	--tea-ink: var(--wp--preset--color--ink);
	--tea-ink-muted: var(--wp--preset--color--ink-muted);
	--tea-line: var(--wp--preset--color--line);
	--tea-surface: var(--wp--preset--color--surface);
	--tea-accent: var(--wp--preset--color--accent);
	--tea-link: var(--wp--preset--color--link);
	--tea-accent-soft: var(--wp--preset--color--accent-soft);
	--tea-mono: var(--wp--preset--font-family--mono);
	--tea-display: var(--wp--preset--font-family--display);

	--tea-container: var(--wp--custom--layout--container, 1360px);
	--tea-sidebar: var(--wp--custom--layout--sidebar, 300px);
	--tea-measure: var(--wp--custom--layout--measure, 760px);
	--tea-gap: var(--wp--custom--layout--gap, 64px);
	--tea-flow: var(--wp--custom--flow, 28px);
	--tea-radius: var(--wp--custom--radius--base, 10px);
	--tea-radius-media: var(--wp--custom--radius--media, 14px);
	--tea-offset: var(--wp--custom--header-offset, 96px);
}

html { scroll-padding-top: var(--tea-offset); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* =========================================================
   MODÈLE ARTICLE — conteneur
   ========================================================= */
.tea-article { margin-block-start: 0; }
.tea-article > * { margin-block: 0; }

/* ---------- HERO ---------- */
.tea-hero { border-bottom: 1px solid var(--tea-line); padding-top: 40px; }
.tea-hero__in {
	max-width: var(--tea-container);
	margin-inline: auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.tea-hero__in > * { margin-block: 0; }
.tea-hero__text {
	padding: 24px 56px 56px 32px;
	display: flex;
	flex-direction: column;
}
.tea-hero__text > * { margin-block: 0; }
.tea-hero__media { padding: 0 32px 40px 24px; }
.tea-hero__media:not(:has(img)) { display: none; }
.tea-hero__in:not(:has(.tea-hero__media img)) { grid-template-columns: minmax(0, 1fr); }
.tea-hero__in:not(:has(.tea-hero__media img)) .tea-hero__text { max-width: 960px; }
.tea-cover, .tea-cover img { border-radius: var(--tea-radius); overflow: hidden; margin: 0; }

.tea-breadcrumb {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
	color: var(--tea-ink-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.tea-breadcrumb__sep { color: var(--tea-accent); }
.tea-breadcrumb a { color: inherit; font-weight: inherit; }
.tea-breadcrumb [aria-current] { color: var(--tea-ink-strong); }

.tea-hero__title { margin-top: 40px !important; text-wrap: balance; }

.tea-hero__meta {
	margin-top: auto !important;
	padding-top: 48px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}
.tea-hero__meta > * { margin-block: 0; }
.tea-hero__date { font-size: 14px; color: var(--tea-ink-strong); font-weight: 500; }
.tea-hero__date::before { content: "Publié le "; font-weight: 400; color: var(--tea-ink-muted); }
.tea-readtime { font-size: 14px; color: var(--tea-ink-muted); display: flex; align-items: center; gap: 12px; }
.tea-readtime::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--tea-accent); }

/* ---------- CHAPÔ ---------- */
.tea-intro { background: var(--tea-accent-soft); padding: 64px 32px; }
.tea-intro__text {
	max-width: 960px;
	margin: 0 auto;
	padding-left: 24px;
	border-left: 3px solid var(--tea-accent);
	font-size: clamp(19px, 2vw, 26px);
	font-weight: 500;
	line-height: 1.375;
	color: var(--tea-ink-strong);
	text-wrap: pretty;
}

/* ---------- LAYOUT 2 COLONNES ---------- */
.tea-layout {
	max-width: var(--tea-container);
	margin-inline: auto;
	padding: 64px 32px 96px;
	display: flex;
	gap: var(--tea-gap);
	justify-content: space-between;
	align-items: flex-start;
}
.tea-layout > * { margin-block: 0; }
.tea-sidebar { flex: 0 0 var(--tea-sidebar); align-self: stretch; }
.tea-sidebar__sticky {
	position: sticky;
	top: var(--tea-offset);
	display: flex;
	flex-direction: column;
	gap: 48px;
}
.tea-sidebar__sticky > * { margin-block: 0; }

/* Sommaire */
.tea-toc__label {
	font-size: 14px;
	font-weight: 600;
	color: var(--tea-ink-strong);
	margin: 0 0 16px;
}
.tea-toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tea-toc__list a {
	display: block;
	padding: 8px 8px 8px 16px;
	border-left: 2px solid var(--tea-line);
	color: var(--tea-ink-muted);
	font-weight: 500;
	line-height: 1.25;
	text-decoration: none;
}
.tea-toc__list a:hover { color: var(--tea-ink-strong); }
.tea-toc__list a.is-active { border-left-color: var(--tea-accent); color: var(--tea-accent); background: var(--tea-accent-soft); border-radius: 0 6px 6px 0; }

/* Encart promo */
.tea-promo {
	border-radius: var(--tea-radius);
	overflow: hidden;
	aspect-ratio: 1 / .9;
	padding: 24px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 16px;
	color: #fff;
	background:
		linear-gradient(180deg, transparent 30%, rgba(0,0,0,.55)),
		radial-gradient(80% 60% at 60% 20%, var(--tea-accent), transparent 70%),
		#1f1638;
	background-size: cover;
}
.tea-promo > * { margin-block: 0; }
.tea-promo__title { font: 800 30px/1.05 var(--tea-display); letter-spacing: -.02em; color: #fff; }
.tea-promo__btn .wp-block-button__link { background: #fff; color: #111; border-radius: 999px; padding: 8px 16px; font-size: 13px; }

/* ---------- CORPS D'ARTICLE ---------- */
.tea-body { flex: 0 1 var(--tea-measure); max-width: var(--tea-measure); }
.tea-body > * { margin-block: 0; }
.tea-body > * + * { margin-block-start: var(--tea-flow) !important; }
.tea-body > h2 { margin-block-start: calc(var(--tea-flow) + 20px) !important; }
.tea-body > h3 { margin-block-start: calc(var(--tea-flow) + 8px) !important; }
.tea-body .alignwide, .tea-body .alignfull { max-width: 100%; margin-inline: 0; }
.tea-body strong { color: var(--tea-ink-strong); font-weight: 600; }
.tea-body ul, .tea-body ol { padding-left: 24px; }
.tea-body li + li { margin-top: 8px; }
.tea-body li::marker { color: var(--tea-ink-strong); }
.tea-body .is-style-tea-aeree li + li { margin-top: 12px; }

/* Médias */
.tea-body .wp-block-embed__wrapper iframe,
.tea-body .wp-block-video video { border-radius: var(--tea-radius-media); display: block; }
.tea-body figcaption, .tea-body .wp-element-caption { margin-top: 10px; font-size: 14px; color: var(--tea-ink-muted); text-align: left; }

/* Blocs code / prompt */
.tea-body .wp-block-code { position: relative; }
.tea-body .wp-block-code code { font: inherit; }
.tea-body .is-style-tea-prompt { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid var(--tea-accent) !important; }
.tea-copy {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border: 1px solid var(--tea-line);
	border-radius: 8px;
	background: var(--tea-bg);
	color: var(--tea-ink-strong);
	cursor: pointer;
}
.tea-copy svg { width: 16px; height: 16px; }
.tea-copy.is-done { color: var(--tea-link); border-color: var(--tea-link); }

/* Encadré astuce */
.is-style-tea-astuce {
	border-left: 3px solid var(--tea-accent);
	background: var(--tea-accent-soft);
	border-radius: 0 var(--tea-radius) var(--tea-radius) 0;
	padding: 16px 20px;
	color: var(--tea-ink-strong);
	font-weight: 500;
}

/* Fin d'article */
.tea-cta a { font-weight: 600; }

/* ---------- BARRE DE PARTAGE ---------- */
.tea-share {
	position: fixed;
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 6px;
	border: 1px solid var(--tea-line);
	border-radius: 14px;
	box-shadow: 0 6px 20px rgba(20, 10, 40, .06);
	background: var(--tea-bg);
}
.tea-share a, .tea-share button {
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--tea-ink-strong);
	cursor: pointer;
}
.tea-share a:hover, .tea-share button:hover { background: var(--tea-accent-soft); color: var(--tea-accent); }
.tea-share svg { width: 16px; height: 16px; }
.tea-share .is-done { color: var(--tea-link); }

:where(.tea-article) :focus-visible { outline: 2px solid var(--tea-link); outline-offset: 3px; border-radius: 4px; }

/* =========================================================
   PAGE BLOG / ARCHIVES — grille
   ========================================================= */
.tea-blog {
	max-width: var(--tea-container);
	margin-inline: auto;
	padding: 64px 32px 96px;
	margin-block-start: 0;
}
.tea-blog > * { margin-block: 0; }

.tea-blog__head { margin-bottom: 32px; }
.tea-blog__title { margin: 0; }
.tea-blog__desc { margin: 12px 0 0; max-width: 716px; font-size: 18px; line-height: 1.5; color: var(--tea-ink-muted); }

/* Pastilles de catégories */
.tea-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.tea-filters a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--tea-line);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	color: var(--tea-ink-strong);
	text-decoration: none;
	transition: border-color .15s, color .15s;
}
.tea-filters a:hover { border-color: var(--tea-accent); color: var(--tea-accent); text-decoration: none; }
.tea-filters a.is-active { background: var(--tea-accent); border-color: var(--tea-accent); color: #fff; }

/* Grille */
.tea-blog__query > * { margin-block: 0; }
.tea-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px 28px;
}
.tea-grid > li { margin: 0; }

/* Carte */
.tea-card { display: flex; flex-direction: column; gap: 16px; height: 100%; }
.tea-card > * { margin-block: 0; }
.tea-card__media { margin: 0; border-radius: var(--tea-radius); overflow: hidden; }
.tea-card__media img { border-radius: var(--tea-radius); transition: transform .4s ease; }
.tea-card__media a { display: block; overflow: hidden; border-radius: var(--tea-radius); }
.tea-card:hover .tea-card__media img { transform: scale(1.04); }
.tea-card__body { display: flex; flex-direction: column; gap: 6px; }
.tea-card__body > * { margin-block: 0; }
.tea-card__cat { font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--tea-accent); display: flex; flex-wrap: wrap; gap: 6px; }
.tea-card__cat a { background: var(--tea-accent-soft); padding: 3px 10px; border-radius: 999px; }
.tea-card__cat .wp-block-post-terms__separator { display: none; }
.tea-card__cat a { color: inherit; font-weight: inherit; text-decoration: none; }
.tea-card__title { font-size: 20px !important; line-height: 1.35 !important; font-weight: 600; text-wrap: balance; margin: 0; }
.tea-card__title a { color: var(--tea-ink-strong); font-weight: inherit; text-decoration: none; }
.tea-card__title a:hover { color: var(--tea-accent); }
.tea-card__excerpt { display: none; }
.tea-card__date { font-size: 13px; color: var(--tea-ink-muted); }

/* Premier article : mis en avant sur toute la largeur */
.tea-grid > li:first-child { grid-column: 1 / -1; }
.tea-grid > li:first-child .tea-card {
	display: grid;
	grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
	gap: 0;
	background: var(--tea-accent-soft);
	border-radius: var(--tea-radius);
	overflow: hidden;
}
.tea-grid > li:first-child .tea-card__media { order: 1; border-radius: 0; height: 100%; }
.tea-grid > li:first-child .tea-card__media a,
.tea-grid > li:first-child .tea-card__media img { border-radius: 0; height: 100%; aspect-ratio: auto !important; min-height: 420px; object-fit: cover; }
.tea-grid > li:first-child .tea-card__body { order: 2; justify-content: center; padding: 48px 56px; gap: 12px; }
.tea-grid > li:first-child .tea-card__title { font-size: clamp(24px, 2.4vw, 32px) !important; line-height: 1.2 !important; }
.tea-grid > li:first-child .tea-card__excerpt { display: block; color: var(--tea-ink); }
.tea-grid > li:first-child .tea-card__excerpt .wp-block-post-excerpt__excerpt { margin: 0; }
.tea-grid > li:first-child .tea-card:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }

/* Pagination */
.tea-pagination { margin-top: 64px !important; gap: 8px; font-weight: 500; }
.tea-pagination a, .tea-pagination .current {
	min-width: 40px;
	height: 40px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	color: var(--tea-ink-strong);
	text-decoration: none;
}
.tea-pagination a:hover { background: var(--tea-surface); }
.tea-pagination .current { background: var(--tea-accent); color: #fff; }

/* =========================================================
   PIED DE PAGE
   ========================================================= */
.tea-footer {
	--tea-f-ink: #bdbdc4;
	--tea-f-strong: #ffffff;
	--tea-f-line: rgba(255, 255, 255, .12);
	background: var(--wp--preset--color--dark);
	background-image: radial-gradient(60% 120% at 100% 0%, rgba(124, 58, 237, .18), transparent 60%);
	color: var(--tea-f-ink);
	padding: 80px 32px 40px;
	margin-block-start: 0;
	font-size: 14px;
	line-height: 1.6;
}
.tea-footer > *, .tea-footer__in > *, .tea-footer__brand > *, .tea-footer__col > *, .tea-footer__bottom > * { margin-block: 0; }
.tea-footer a { color: var(--tea-f-ink); font-weight: 400; text-decoration: none; }
.tea-footer a:hover { color: var(--tea-f-strong); text-decoration: none; }

.tea-footer__in {
	max-width: var(--tea-container);
	margin-inline: auto;
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	justify-content: space-between;
	gap: 48px 32px;
}
.tea-footer__brand { display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.tea-footer__title, .tea-footer__title a { font: 800 22px/1.2 var(--tea-display); letter-spacing: -.02em; color: var(--tea-f-strong); }
.tea-footer__tagline { color: var(--tea-f-ink); }
.tea-footer__logo img { filter: brightness(0) invert(1); }

.tea-footer__heading { font-size: 15px !important; font-weight: 600; line-height: 1.4 !important; color: #b9a3ff !important; margin-bottom: 16px !important; }
.tea-footer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tea-footer__list li { margin: 0; }
.tea-footer__cats .cat-item { list-style: none; }

.tea-footer__bottom {
	max-width: var(--tea-container);
	margin: 64px auto 0 !important;
	padding-top: 24px;
	border-top: 1px solid var(--tea-f-line);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px 32px;
	font-size: 13px;
}
.tea-footer__legal { display: flex; flex-wrap: wrap; gap: 24px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1000px) {
	.tea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.tea-footer { padding: 56px 20px 32px; }
	.tea-footer__in { grid-template-columns: minmax(0, 1fr); }
	.tea-blog { padding: 40px 20px 64px; }
	.tea-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding-inline: 20px; scrollbar-width: none; }
	.tea-filters a { flex: none; }
	.tea-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
	.tea-grid > li:first-child .tea-card { grid-template-columns: minmax(0, 1fr); }
	.tea-grid > li:first-child .tea-card__media { order: 0; }
	.tea-grid > li:first-child .tea-card__media img { min-height: 0; aspect-ratio: 4 / 3 !important; }
	.tea-grid > li:first-child .tea-card__body { padding: 24px; }
}
@media (max-width: 1100px) {
	.tea-sidebar, .tea-share { display: none; }
	.tea-layout { justify-content: center; }
}
@media (max-width: 860px) {
	.tea-hero__in { grid-template-columns: minmax(0, 1fr); }
	.tea-hero__text { border-right: 0; padding: 16px 20px 32px; }
	.tea-hero__media { padding: 0 20px 32px; }
	.tea-intro { padding: 48px 20px; }
	.tea-layout { padding: 40px 20px 64px; }
	.tea-body .wp-block-code { padding: 24px 56px 24px 20px !important; }
}
