/* ==========================================================================
   Contenu : pages, articles, archives (catégories, mots-clés)
   Reprend fidèlement le CSS additionnel d'origine, en remplaçant les hex par des jetons.
   La page d'accueil (page_on_front) garde sa mise en page propre : on n'y touche pas.
   ========================================================================== */

/* ---------- Pages internes (hors accueil) ---------- */
body.page:not(.home):not(.uk-own-layout) .entry-title {
	font-size: clamp(28px, 4.2vw, 44px);
}
body.page:not(.home):not(.uk-own-layout) .entry-title::after {
	content: ""; display: block; width: 72px; height: 6px; background: var(--uk-yellow); margin-top: 20px;
}
body.page:not(.home):not(.uk-own-layout) .entry-content { font-size: var(--uk-fs-article); line-height: 1.8; }
body:not(.uk-own-layout) .entry-content ul li::marker { color: var(--uk-blue); }
body:not(.uk-own-layout) .entry-content h2, body:not(.uk-own-layout) .entry-content h3, body:not(.uk-own-layout) .entry-content h4 { margin: 1.8em 0 .6em; }
body:not(.uk-own-layout) .entry-content h2 { font-size: clamp(24px, 3vw, 32px); padding-left: 16px; border-left: 6px solid var(--uk-yellow); }
body:not(.uk-own-layout) .entry-content h3 { font-size: clamp(20px, 2.4vw, 26px); color: var(--uk-blue); }
body:not(.uk-own-layout) .entry-content blockquote {
	background: var(--uk-cyan); border-left: 6px solid var(--uk-blue); color: var(--uk-ink);
	margin: 2em 0; padding: 20px 28px; font-style: italic;
}
body:not(.uk-own-layout) .entry-content blockquote p:last-child { margin-bottom: 0; }
body:not(.uk-own-layout) .entry-content hr { border: 0; height: 4px; background: var(--uk-yellow); width: 72px; margin: 2.5em 0; }
body:not(.uk-own-layout) .entry-content figcaption { font-size: var(--uk-fs-md); color: var(--uk-muted); font-style: italic; }
body:not(.uk-own-layout) .entry-content table { border-collapse: collapse; width: 100%; }
body:not(.uk-own-layout) .entry-content th { background: var(--uk-navy); color: var(--uk-on-blue); text-align: left; }
body:not(.uk-own-layout) .entry-content th, body:not(.uk-own-layout) .entry-content td { padding: 12px 14px; border: 1px solid var(--uk-border-strong); }
body:not(.uk-own-layout) .entry-content tbody tr:nth-child(even) { background: var(--uk-bg); }

/* ---------- Article seul ---------- */
body.single-post.ast-separate-container,
body.single-post.ast-separate-container .site-content { background: var(--uk-bg); }
body.single-post.ast-narrow-container .site-content > .ast-container { max-width: 940px; }
body.single-post.ast-separate-container .ast-article-single {
	background: var(--uk-surface); border-top: 6px solid var(--uk-blue); border-radius: 0;
	box-shadow: var(--uk-shadow-2); padding: var(--uk-pad) !important;
}
body.single-post .entry-title { font-size: clamp(28px, 4.2vw, 44px); margin-bottom: 20px; }
body.single-post .entry-title::after { content: ""; display: block; width: 72px; height: 6px; background: var(--uk-yellow); margin-top: 20px; }
body.single-post .entry-meta, body.single-post .entry-meta a { font-size: var(--uk-fs-md); font-weight: 600; color: var(--uk-muted); }
body.single-post .entry-meta a, body.single-post .entry-meta .author-name, body.single-post .entry-meta .posted-by { color: var(--uk-blue); }
body.single-post .entry-meta a:hover { color: var(--uk-navy); text-decoration: underline; }
body.single-post .post-thumb-img-content img,
body.single-post .ast-single-post .wp-post-image { border-radius: 0; box-shadow: none; border-bottom: 6px solid var(--uk-yellow); width: 100%; height: auto; }
body.single-post .entry-content { font-size: var(--uk-fs-article); line-height: 1.8; }
body.single-post .entry-content p { margin-bottom: 1.4em; }
body.single-post .entry-footer :is(.tags-links, .cat-links) a { margin: 0 6px 6px 0; }
body.single-post .post-navigation a { color: var(--uk-blue); font-weight: 700; }
body.single-post .post-navigation a:hover { color: var(--uk-navy); }
body.single-post .comments-area .comment-reply-title { font-family: var(--uk-font-display); font-weight: 800; color: var(--uk-navy); }
@media (max-width: 921px) {
	body.single-post .entry-content { font-size: var(--uk-fs-lg); }
	body.single-post.ast-separate-container .ast-article-single { border-top-width: 4px; }
}

/* ---------- Archives : bannière + grille « À la une + liste, puis cartes » ---------- */
body.archive.ast-separate-container,
body.archive.ast-separate-container .site-content { background: var(--uk-bg); }

body.archive .ast-archive-entry-banner {
	background: var(--uk-hero), var(--uk-surface) !important;
	text-align: left; padding: 52px 0 !important; min-height: 0 !important;
}
body.archive .ast-archive-entry-banner::before { display: none; }
body.archive .ast-archive-entry-banner > .ast-container { display: block; text-align: left; padding-inline: 20px; }
body.archive .ast-archive-entry-banner h1 {
	font-family: var(--uk-font-display) !important; font-weight: 800 !important; color: var(--uk-on-blue); text-align: left;
	font-size: clamp(30px, 5vw, 48px) !important; line-height: 1.15; margin: 0;
}
body.archive .ast-archive-entry-banner h1::before {
	display: block; margin-bottom: 6px; font-family: var(--uk-font-body); font-size: var(--uk-fs-sm); font-weight: 700;
	letter-spacing: .08em; text-transform: uppercase; color: var(--uk-yellow);
}
body.archive .ast-archive-entry-banner h1::after { display: none; }
body.category .ast-archive-entry-banner h1::before { content: "Catégorie"; }
body.tag .ast-archive-entry-banner h1::before { content: "Mot-clé"; }
body.author .ast-archive-entry-banner h1::before { content: "Auteur"; }
body.date .ast-archive-entry-banner h1::before { content: "Archives"; }

body.archive #secondary { display: none; }
body.archive #primary { width: 100%; max-width: none; margin: 0; padding: 40px 0 56px !important; border: 0; }

/* Cartes */
body.archive .ast-article-post { position: relative; }
body.archive .ast-article-post .ast-article-inner {
	background: var(--uk-surface); border: 1px solid var(--uk-border); border-top: 4px solid var(--uk-blue);
	border-radius: 0; box-shadow: none; height: 100%;
	transition: box-shadow var(--uk-dur) var(--uk-ease), transform var(--uk-dur) var(--uk-ease);
}
body.archive .ast-article-post:hover .ast-article-inner { box-shadow: var(--uk-shadow-1); }
body.archive .ast-article-post .post-thumb { overflow: hidden; }
body.archive .ast-article-post .post-thumb-img-content img {
	width: 100%; height: 190px; object-fit: cover; border: 0; border-radius: 0;
	transition: transform var(--uk-dur-slow) var(--uk-ease);
}
body.archive .ast-article-post:hover .post-thumb-img-content img { transform: scale(1.04); }
body.archive .ast-article-post .entry-title { margin: 0; font-size: var(--uk-fs-card); line-height: 1.3; }
body.archive .ast-article-post .entry-title a { font-family: var(--uk-font-display); font-weight: 800; color: var(--uk-ink); text-decoration: none; }
body.archive .ast-article-post .entry-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* toute la carte est cliquable */
body.archive .ast-article-post .entry-title a:hover { color: var(--uk-blue); }

body.archive .ast-article-post .post-content { display: flex; flex-direction: column; }
body.archive .ast-article-post .ast-blog-meta-container,
body.archive .ast-article-post .ast-blog-meta-container .entry-meta { display: contents; }
body.archive .ast-article-post .ast-blog-meta-container .entry-meta { font-size: 0; line-height: 0; }
body.archive .ast-article-post .post-thumb { order: 0; }
body.archive .ast-article-post .cat-links { order: 1; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; font-size: 0; line-height: 0; }
body.archive .ast-article-post .entry-title { order: 2; }
body.archive .ast-article-post .posted-on { order: 3; margin: 10px 0 0; font-size: var(--uk-fs-sm); font-weight: 700; color: var(--uk-muted); }
body.archive .ast-article-post .ast-excerpt-container { order: 4; margin-top: 8px; font-size: var(--uk-fs-ui); color: var(--uk-muted); line-height: 1.65; }
body.archive .ast-article-post .read-more { display: none; }
body.archive .ast-article-post .cat-links a { position: relative; z-index: 2; }
body.archive .ast-article-post .posted-on .updated,
body.archive .ast-article-post .ast-blog-meta-container .posted-by,
body.archive .ast-article-post .ast-blog-meta-container .comments-link { display: none; }
body.archive .ast-article-post .posted-on a, body.archive .ast-article-post .posted-on time { color: var(--uk-muted); font-weight: 700; text-decoration: none; }

/* Pagination */
body.archive .ast-pagination { text-align: center; margin-top: 28px; }
body.archive .ast-pagination .page-numbers, body.archive .navigation .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: var(--uk-target); min-height: var(--uk-target);
	border: 0; background: transparent; border-radius: 0; color: var(--uk-blue); font-weight: 700;
}
body.archive .ast-pagination .page-numbers.current, body.archive .navigation .page-numbers.current { color: var(--uk-navy); box-shadow: inset 0 -4px var(--uk-yellow); }
body.archive .ast-pagination a.page-numbers:hover, body.archive .navigation a.page-numbers:hover { color: var(--uk-navy); text-decoration: underline; }

/* Grille 12 colonnes : 1er article à la une, 3 suivants en liste, le reste en cartes */
body.archive .ast-row { display: grid !important; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin: 0 !important; width: auto; align-items: stretch; }
body.archive .ast-row > .ast-article-post { width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; grid-column: span 4; }
body.archive .ast-row > .ast-article-post:nth-child(1) { grid-column: 1 / 8; grid-row: 1 / 4; }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) { grid-column: 8 / 13; align-self: start; }

body.archive .ast-row:has(> .ast-article-post:nth-child(5))::after {
	grid-column: 1 / -1; grid-row: 4; margin: 32px 0 -2px;
	font-family: var(--uk-font-display); font-weight: 800; font-size: var(--uk-fs-section); line-height: 1.15; color: var(--uk-ink);
}
body.category .ast-row:has(> .ast-article-post:nth-child(5))::after { content: "Plus d'articles dans cette catégorie"; }
body.tag .ast-row:has(> .ast-article-post:nth-child(5))::after { content: "Plus d'articles avec ce mot-clé"; }

body.archive .ast-row > .ast-article-post:nth-child(1) .ast-article-inner { border: 0; border-bottom: 4px solid var(--uk-blue); padding-bottom: 20px; }
body.archive .ast-row > .ast-article-post:nth-child(1) .post-thumb-img-content img { height: 300px; }
body.archive .ast-row > .ast-article-post:nth-child(1) .entry-title { order: 1; margin-top: 18px; font-size: var(--uk-fs-feature); }
body.archive .ast-row > .ast-article-post:nth-child(1) .ast-excerpt-container { order: 2; margin-top: 12px; }
body.archive .ast-row > .ast-article-post:nth-child(1) .cat-links { order: 3; margin-top: 14px; }
body.archive .ast-row > .ast-article-post:nth-child(1) .posted-on { display: none; }

body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .ast-article-inner { border: 0; padding: 0 !important; }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .post-content { display: grid; grid-template-columns: 130px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 120px; }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .post-thumb { grid-column: 1; grid-row: 1 / 3; margin: 0 !important; }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .post-thumb-img-content,
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .post-thumb-img-content a { display: block; height: 100%; }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .post-thumb-img-content img { height: 100%; min-height: 120px; }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .entry-title { grid-column: 2; grid-row: 1; padding: 14px 16px 0; font-size: var(--uk-fs-lg); }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) .cat-links { grid-column: 2; grid-row: 2; align-self: end; margin: 10px 16px 14px; }
body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) :is(.posted-on, .ast-excerpt-container, .read-more) { display: none; }

@media (max-width: 921px) {
	body.archive .ast-archive-entry-banner { padding: 40px 0 !important; }
	body.archive #primary { padding: 32px 0 40px !important; }
	body.archive .ast-row { grid-template-columns: 1fr; }
	body.archive .ast-row > .ast-article-post,
	body.archive .ast-row > .ast-article-post:nth-child(1),
	body.archive .ast-row > .ast-article-post:nth-child(n+2):nth-child(-n+4) { grid-column: 1 / -1; grid-row: auto; }
	body.archive .ast-row:has(> .ast-article-post:nth-child(5))::after { grid-row: 5; }
}
@media (prefers-reduced-motion: reduce) {
	body.archive .ast-article-post .post-thumb-img-content img { transition: none; }
	body.archive .ast-article-post:hover .post-thumb-img-content img { transform: none; }
}
