/*
Theme Name: Kiasma Blog
Theme URI: https://blog.kiasma.ai
Author: Kiasma
Author URI: https://kiasma.ai
Description: Thème du blog Kiasma pour les organismes de formation en santé. Identité visuelle de kiasma.ai (police Outfit, dégradé bleu-prune-orange, vignettes prune) et page d'accueil en rangées défilantes par thématique.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.1.0
License: GPLv2 or later
Text Domain: kiasma-blog
*/

/* ---------- Bases ---------- */
:root {
	--k-gradient: linear-gradient(74deg, #243985, #9b466c 50%, #f49c3b);
	--k-card: #764273;
	--k-card-dark: #704275;
	--k-radius: 20px;
	--k-pill: 27px;
	--k-shadow: 0 0 20px #00000026;
	--k-gutter: clamp(16px, 5vw, 125px);
}
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
a { text-underline-offset: .18em; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* ---------- En-tête ---------- */
.k-header {
	position: sticky; top: 0; z-index: 50;
	padding-left: var(--k-gutter) !important; padding-right: var(--k-gutter) !important;
	background: #fff;
	box-shadow: 0 2px 4px rgba(0,0,0,.075);
}
.admin-bar .k-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .k-header { top: 46px; } }
.k-header .wp-block-navigation a { font-weight: 500; color: var(--wp--preset--color--prune); text-decoration: none; }
.k-header .wp-block-navigation a:hover { color: var(--wp--preset--color--prune-fonce); }
.k-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; }

.k-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1; }
.k-logo img { width: 34px; height: 44px; display: block; }
.k-logo__mot {
	font-weight: 600; font-size: 22px; letter-spacing: .32em;
	background: var(--k-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.k-logo__suffixe { font-size: 13px; font-weight: 500; letter-spacing: .08em; color: var(--wp--preset--color--prune); text-transform: uppercase; margin-left: -2px; }

/* ---------- Boutons ---------- */
.wp-element-button, .wp-block-button__link { transition: background .2s, color .2s, border-color .2s; }
.is-style-k-contour .wp-block-button__link,
.k-btn--contour {
	background: transparent !important; color: var(--wp--preset--color--prune) !important;
	border: 1px solid var(--wp--preset--color--prune) !important;
}
.is-style-k-contour .wp-block-button__link:hover, .k-btn--contour:hover { background: var(--wp--preset--color--prune) !important; color: #fff !important; }

.k-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border-radius: var(--k-pill); padding: 12px 26px; font-weight: 500; font-size: 16px;
	text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: all .2s ease-out;
}
.k-btn--blanc { background: #fff; color: var(--k-card-dark); }
.k-btn--blanc:hover { background: #fff; color: #6c4176; transform: translateY(-1px); }
.k-btn--verre { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.45); backdrop-filter: blur(4px); }
.k-btn--verre:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- Surtitres ---------- */
.k-surtitre, .is-style-k-surtitre {
	text-transform: uppercase; letter-spacing: .1em; font-weight: 600; font-size: 16px;
	color: var(--wp--preset--color--corail); margin: 0 0 6px;
}

/* ---------- À la une (hero) ---------- */
.k-une { position: relative; color: #fff; overflow: hidden; background: var(--k-gradient); }
.k-une__slide {
	position: relative; min-height: clamp(460px, 72vh, 720px);
	display: none; align-items: flex-end;
}
.k-une__slide.is-active { display: flex; animation: k-fondu .6s ease; }
@keyframes k-fondu { from { opacity: 0; } to { opacity: 1; } }
.k-une__media { position: absolute; inset: 0; }
.k-une__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-une__media::after {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(90deg, rgba(36,57,133,.92) 0%, rgba(118,66,115,.72) 38%, rgba(118,66,115,0) 72%),
		linear-gradient(0deg, rgba(36,57,133,.55) 0%, rgba(36,57,133,0) 45%);
}
.k-une__slide--sans-image .k-une__media { background: var(--k-gradient); }
.k-une__slide--sans-image .k-une__media::after {
	background: url("assets/images/k-picto.svg") no-repeat right 8% center / auto 78%;
	opacity: .18; filter: brightness(10);
}
.k-une__contenu { position: relative; z-index: 1; padding: 0 var(--k-gutter) clamp(56px, 9vh, 96px); max-width: 760px; }
.k-une__contenu .k-surtitre { color: #fff; opacity: .9; }
.k-une__badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; margin-bottom: 18px; }
.k-une__titre { font-size: clamp(32px, 4.6vw, 58px); line-height: 1.08; font-weight: 600; margin: 0 0 16px; color: #fff; }
.k-une__titre a { color: inherit; text-decoration: none; }
.k-une__extrait { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; opacity: .92; margin: 0 0 28px; max-width: 620px; }
.k-une__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.k-une__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.k-une__points { position: absolute; right: var(--k-gutter); bottom: 40px; z-index: 2; display: flex; gap: 8px; }
.k-une__point { width: 28px; height: 4px; border-radius: 4px; border: 0; padding: 0; background: rgba(255,255,255,.4); cursor: pointer; }
.k-une__point.is-active { background: #fff; }

/* ---------- Pastilles (étiquettes) ---------- */
.k-pastille {
	display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
	border: 1px solid hsla(0,0%,100%,.35); border-radius: 999px; color: #fff;
	font-size: 13px; line-height: 1; padding: 6px 12px;
}
.k-pastille svg { width: 14px; height: 14px; flex: none; }
.k-pastille--orange { border-color: #f49c3b; color: #fff; font-weight: 600; }

/* ---------- Filtres thématiques ---------- */
.k-filtres { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 var(--k-gutter); margin: 40px 0 8px; }
.k-filtre {
	border: 1px solid #cecece; border-radius: 999px; padding: 7px 18px; font-size: 14px; font-weight: 500;
	color: var(--wp--preset--color--prune); text-decoration: none; background: #fff; transition: all .2s;
}
.k-filtre:hover { border-color: var(--wp--preset--color--prune); }
.k-filtre.is-active { background: var(--wp--preset--color--prune); border-color: var(--wp--preset--color--prune); color: #fff; }

/* ---------- Rangées ---------- */
.k-rangees { padding: 24px 0 56px; }
.k-rangee { margin-top: 40px; position: relative; }
.k-rangee__entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 var(--k-gutter); margin-bottom: 18px; }
.k-rangee__titre { margin: 0; font-size: clamp(20px, 2vw, 26px); font-weight: 500; color: var(--wp--preset--color--encre); }
.k-rangee__tout { color: var(--wp--preset--color--prune); font-weight: 500; text-decoration: none; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.k-rangee__tout:hover { color: var(--wp--preset--color--prune-fonce); }
.k-rangee__tout span { transition: transform .2s; }
.k-rangee__tout:hover span { transform: translateX(4px); }

.k-rangee__piste {
	display: grid; grid-auto-flow: column; grid-auto-columns: clamp(250px, 23vw, 300px);
	gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-padding-inline: var(--k-gutter);
	padding: 14px var(--k-gutter) 28px; margin: 0; list-style: none;
	scrollbar-width: none;
}
.k-rangee__piste::-webkit-scrollbar { display: none; }
.k-rangee__piste > li { scroll-snap-align: start; display: flex; }

.k-fleche {
	position: absolute; top: 50%; z-index: 5; transform: translateY(-20%);
	width: 34px; height: 64px; border: 0; cursor: pointer;
	background: var(--wp--preset--color--prune); color: #fff; display: grid; place-items: center;
	opacity: 0; transition: opacity .2s, background .2s;
}
.k-fleche:hover { background: #6c4176; }
.k-fleche--prec { left: 0; border-radius: 0 14px 14px 0; }
.k-fleche--suiv { right: 0; border-radius: 14px 0 0 14px; }
.k-rangee:hover .k-fleche:not([disabled]), .k-fleche:focus-visible { opacity: 1; }
.k-fleche[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .k-fleche { display: none; } }

/* ---------- Vignette (carte article, style kiasma.ai) ---------- */
.k-carte {
	position: relative; width: 100%; display: flex; flex-direction: column;
	background: var(--k-card); color: #fff; border-radius: var(--k-radius);
	box-shadow: var(--k-shadow); overflow: hidden; min-height: 400px;
	transition: transform .25s ease, box-shadow .25s ease;
}
.k-carte:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(118,66,115,.35); }
.k-carte__image { position: relative; aspect-ratio: 4 / 3; flex: none; overflow: hidden; border-radius: var(--k-radius) var(--k-radius) 0 0; }
.k-carte__image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.k-carte:hover .k-carte__image img { transform: scale(1.06); }
.k-carte__image::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(118,66,115,0) 0, rgba(118,66,115,.55) 60%, #764273);
}
.k-carte__image--vide { background: var(--k-gradient); }
.k-carte__image--vide::before {
	content: ""; position: absolute; inset: 18% 30%;
	background: url("assets/images/k-picto.svg") no-repeat center / contain;
	filter: brightness(10); opacity: .35;
}
.k-carte__corps { position: relative; z-index: 1; flex: 1; margin-top: -64px; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.k-carte__pied { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.k-carte__cat { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .78; margin: 0; }
.k-carte__titre { font-size: 17px; line-height: 1.35; font-weight: 600; margin: 0; color: #fff;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.k-carte__titre a { color: inherit; text-decoration: none; }
.k-carte__titre a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--k-radius); }
.k-carte__extrait { font-size: 14px; line-height: 1.45; opacity: .85; margin: 0;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.k-carte__pastilles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; margin-top: 4px; }
.k-carte__pastilles > div { display: flex; gap: 6px; flex-wrap: wrap; }
.k-carte__btn {
	position: relative; z-index: 2; display: block; text-align: center;
	background: #fff; color: var(--k-card-dark); border-radius: var(--k-pill);
	font-size: 14px; line-height: 19px; font-weight: 500; padding: 12px 16px; text-decoration: none; margin-top: 6px;
}
.k-carte__btn:hover { color: #6c4176; background: #fff; }
.k-carte:focus-within { outline: 3px solid #f49c3b; outline-offset: 3px; }

/* ---------- Grille (archives, recherche) ---------- */
.k-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; padding: 0 var(--k-gutter); margin: 32px 0 0; list-style: none; }
.k-grille > li { display: flex; }

/* ---------- Bandeau (archives, article, pages) ---------- */
.k-bandeau { background: var(--k-gradient); color: #fff; }
.k-bandeau a { color: #fff; }
.k-bandeau .wp-block-post-title, .k-bandeau .wp-block-query-title { color: #fff; }
.k-fil { font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.k-fil a { text-decoration: none; font-weight: 500; }
.k-fil span { opacity: .85; }

/* ---------- Article ---------- */
.k-article-image img { border-radius: var(--k-radius); box-shadow: var(--k-shadow); }
.k-article-image { margin-top: -90px !important; position: relative; z-index: 2; }
.k-meta-blanc { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-block-post-content > p:first-child { font-size: 1.15em; }
.wp-block-post-content blockquote { border-left: 4px solid var(--wp--preset--color--prune); background: #f8f6f8; border-radius: 0 14px 14px 0; padding: 18px 24px; margin-inline: 0; }
.wp-block-post-terms.is-style-k-pastilles a {
	display: inline-block; border: 1px solid #cecece; border-radius: 999px; padding: 5px 14px; margin: 0 6px 6px 0;
	font-size: 14px; text-decoration: none; color: var(--wp--preset--color--prune);
}
.wp-block-post-terms.is-style-k-pastilles .wp-block-post-terms__separator { display: none; }

/* ---------- Pagination ---------- */
.wp-block-query-pagination { gap: 8px; }
.wp-block-query-pagination-numbers .page-numbers {
	display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: 999px;
	border: 1px solid #cecece; text-decoration: none; color: var(--wp--preset--color--prune); margin: 0 3px; padding: 0 10px;
}
.wp-block-query-pagination-numbers .page-numbers.current { background: var(--wp--preset--color--prune); color: #fff; border-color: var(--wp--preset--color--prune); }

/* ---------- Recherche ---------- */
.k-header .wp-block-search__input { border-radius: 999px; border: 1px solid #cecece; padding: 8px 16px; font-family: inherit; }
.wp-block-search__button { border-radius: 999px !important; }

/* ---------- Pied de page ---------- */
.k-footer a { text-decoration: none; color: var(--wp--preset--color--prune); }
.k-footer a:hover { color: var(--wp--preset--color--prune-fonce); }
.k-footer .k-titre-col { color: var(--wp--preset--color--corail); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; font-size: 16px; }
.k-footer ul { list-style: none; padding: 0; margin: 0; }
.k-footer li { margin: 0 0 10px; }
.k-footer .k-logo { flex-direction: column; gap: 14px; }
.k-footer .k-logo img { width: 80px; height: 104px; }
.k-footer .k-logo__suffixe { display: none; }
.k-footer .k-logo__mot { font-size: 26px; }
.k-footer-bas { border-top: 1px solid #ececec; font-size: 14px; }
.k-reseaux { display: flex; gap: 8px; }
.k-reseaux a { width: 30px; height: 30px; border-radius: 50%; background: var(--wp--preset--color--corail); color: #fff !important; display: grid; place-items: center; }
.k-reseaux svg { width: 14px; height: 14px; fill: #fff; }

/* ---------- Accessibilité ---------- */
:focus-visible { outline: 3px solid #f49c3b; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 600px) {
	.k-rangee__piste { grid-auto-columns: 78%; gap: 14px; }
	.k-une__points { left: var(--k-gutter); right: auto; bottom: 20px; }
	.k-article-image { margin-top: -50px !important; }
}

.k-une__badge svg { width: 14px; height: 14px; }
.k-footer a.wp-element-button { color: #fff; }
.k-footer a.wp-element-button:hover { color: #fff; }
.k-header .wp-block-navigation .wp-block-navigation-item__content { color: var(--wp--preset--color--prune); }
.k-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--prune-fonce); }
.k-header .wp-block-search__button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
.wp-block-search__input { border-radius: 999px; border: 1px solid #cecece; padding: 10px 18px; font-family: inherit; font-size: 16px; }
.k-bandeau .wp-block-search__input { border-color: rgba(255,255,255,.6); }
@media (max-width: 781px) {
	.k-header .wp-block-buttons { display: none; }
	.k-logo__suffixe { display: none; }
	.k-header > .wp-block-group { gap: 12px; }
}
@media (max-width: 600px) {
	.k-filtres { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
	.k-filtres::-webkit-scrollbar { display: none; }
	.k-filtre { flex: none; }
}

/* Bandeau : l'image occupe la droite et se fond dans le dégradé */
@media (min-width: 782px) { .k-une .k-une__slide .k-une__media { left: auto; right: 0; width: 62%; } .k-une .k-une__slide .k-une__media img { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 35%); mask-image: linear-gradient(90deg, transparent 0, #000 35%); } .k-une .k-une__slide:not(.k-une__slide--sans-image) .k-une__media::after { background: none; } }
@media (max-width: 781px) { .k-une .k-une__slide { flex-direction: column; align-items: stretch; min-height: 0; } .k-une .k-une__slide .k-une__media { position: relative; inset: auto; aspect-ratio: 16 / 9; } .k-une .k-une__slide .k-une__media img { -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); } .k-une .k-une__slide .k-une__media::after { background: none; } .k-une .k-une__slide--sans-image .k-une__media { display: none; } .k-une .k-une__contenu { padding-top: 8px; padding-bottom: 64px; } .k-une .k-une__slide--sans-image .k-une__contenu { padding-top: 48px; } }

/* En-tête aligné sur landing.kiasma.ai */
.k-header { background: #fff !important; box-shadow: none !important; border-bottom: 1px solid #e5e7eb; } header.k-header .wp-block-navigation .wp-block-navigation-item__content { color: #111827; font-weight: 400; font-size: 15.2px; } header.k-header .wp-block-navigation .wp-block-navigation-item__content:hover, header.k-header .wp-block-navigation .is-current .wp-block-navigation-item__content { color: var(--wp--preset--color--prune); } header.k-header .wp-block-navigation .is-current .wp-block-navigation-item__content { font-weight: 500; } .is-style-k-degrade .wp-block-button__link { background: linear-gradient(74deg, #9b466c, #f49c3b) !important; color: #fff !important; border-radius: 9999px; font-weight: 400; border: 0; padding: 12px 26px; } .is-style-k-degrade .wp-block-button__link:hover { filter: brightness(1.06); }

/* Titre principal de l'accueil (H1) */
.k-intro { padding: 48px var(--k-gutter) 0; }
.k-intro h1 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 500; margin: 0 0 8px; color: var(--wp--preset--color--encre); }
.k-intro p { margin: 0; max-width: 760px; color: #555; }
.k-intro + .k-filtres { margin-top: 24px; }
