/*----------------------------------------------------------------------
    * Animations : breadcrumb, listes d'articles, lecture d'article
------------------------------------------------------------------------*/
:root {
  --anim-ease: cubic-bezier(.22, .61, .36, 1);
  --anim-spring: cubic-bezier(.34, 1.56, .64, 1);
  --anim-primary: #F2B514;
  --anim-primary-dark: #d99a00;
  --anim-ink: #1d1d1f;
}

/* =====================================================================
   BREADCRUMB : rail en capsule, chips et indicateur de page active
   ===================================================================== */
.kb-nav {
  padding-top: 1rem;
}

.u-breadcrumb.kb-breadcrumb {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .25rem;
  max-width: 100%;
  padding: .3rem;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 999px;
  box-shadow: 0 6px 20px -12px rgba(0, 0, 0, .25);
  animation: kb-rail-in .8s var(--anim-ease) both;
}
.kb-breadcrumb::-webkit-scrollbar { display: none; }

@keyframes kb-rail-in {
  from { clip-path: inset(0 100% 0 0 round 999px); opacity: .4; }
  to   { clip-path: inset(0 0 0 0 round 999px); opacity: 1; }
}

/* Séparateur : chevron dessiné en CSS */
.u-breadcrumb.kb-breadcrumb .breadcrumb-item { padding-left: 0; }
.u-breadcrumb.kb-breadcrumb .breadcrumb-item::before { display: none; }
.kb-item {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
  opacity: 0;
  animation: kb-item-in .55s var(--anim-spring) both;
}
.kb-item + .kb-item::before {
  content: "" !important;
  display: inline-block !important;
  width: .4rem;
  height: .4rem;
  margin: 0 .45rem 0 .2rem;
  padding: 0 !important;
  border-top: 1.5px solid #adb5bd;
  border-right: 1.5px solid #adb5bd;
  transform: rotate(45deg);
  float: none !important;
}
.kb-item:nth-child(1) { animation-delay: .25s; }
.kb-item:nth-child(2) { animation-delay: .35s; }
.kb-item:nth-child(3) { animation-delay: .45s; }
.kb-item:nth-child(4) { animation-delay: .55s; }
.kb-item:nth-child(n+5) { animation-delay: .65s; }

@keyframes kb-item-in {
  from { opacity: 0; transform: translateY(8px) scale(.9); }
  to   { opacity: 1; transform: none; }
}

/* Chip */
.u-breadcrumb .kb-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  color: #6c757d;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color .3s ease, transform .3s var(--anim-spring);
}
/* Remplissage "liquide" au survol, depuis la position de la souris */
.u-breadcrumb a.kb-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle at var(--kx, 50%) var(--ky, 50%), rgba(242, 181, 20, .35), rgba(242, 181, 20, .12) 60%);
  transform: scale(0);
  opacity: 0;
  transition: transform .45s var(--anim-ease), opacity .3s ease;
}
.u-breadcrumb a.kb-link:hover,
.u-breadcrumb a.kb-link:focus-visible {
  color: var(--anim-ink);
  transform: translateY(-1px);
}
.u-breadcrumb a.kb-link:hover::before,
.u-breadcrumb a.kb-link:focus-visible::before {
  transform: scale(1);
  opacity: 1;
}
.kb-icon {
  flex-shrink: 0;
  transition: transform .4s var(--anim-spring);
}
.kb-link:hover .kb-icon { transform: translateY(-2px) rotate(-8deg); }

/* Page active : chip pleine avec reflet qui balaie */
.kb-item.is-current { min-width: 0; flex-shrink: 1; }
.kb-item.is-current .kb-link {
  color: var(--anim-ink);
  font-weight: 600;
  background: linear-gradient(135deg, var(--anim-primary), #ffd25e);
  box-shadow: 0 4px 12px -4px rgba(242, 181, 20, .7);
  max-width: 100%;
}
.kb-item.is-current .kb-text {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.kb-item.is-current .kb-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: skewX(-20deg);
  animation: kb-shine 3.5s ease-in-out 1s infinite;
}
@keyframes kb-shine {
  0%, 60% { left: -60%; }
  100%    { left: 130%; }
}

@media (max-width: 575.98px) {
  .u-breadcrumb.kb-breadcrumb {
    display: flex;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
}

/* =====================================================================
   BREAKING NEWS : bandeau défilant
   ===================================================================== */
.bn-ticker {
  --bn-accent: #e53935;
  --bn-ink: #17212b;
  --bn-muted: #718096;
  --bn-speed: 44s;
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  color: var(--bn-ink);
  background: #fff;
  border: 1px solid rgba(23, 33, 43, .1);
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(23, 33, 43, .055);
  box-sizing: border-box;
}
.bn-ticker *, .bn-ticker *::before, .bn-ticker *::after { box-sizing: border-box; }
.bn-ticker:focus-within { border-color: rgba(229, 57, 53, .42); }
.bn-label {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--bn-accent);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.bn-label::after {
  position: absolute;
  top: 0;
  right: -10px;
  width: 20px;
  height: 100%;
  background: var(--bn-accent);
  content: '';
  transform: skewX(-12deg);
}
.bn-bolt, .bn-live, .bn-label-text, .bn-count, .bn-toggle { position: relative; z-index: 1; }
.bn-bolt { flex: 0 0 auto; }
.bn-live { display: inline-flex; width: 8px; height: 8px; flex: 0 0 auto; align-items: center; justify-content: center; }
.bn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .65);
  animation: bn-live-pulse 1.8s ease-out infinite;
}
.bn-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  font-size: .68rem;
  letter-spacing: 0;
}
.bn-toggle {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.bn-toggle:hover { background: rgba(255, 255, 255, .17); transform: scale(1.06); }
.bn-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bn-toggle .bn-ico-play { display: none; }
.bn-viewport {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  margin-left: 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.bn-track {
  display: flex;
  width: max-content;
  flex: 0 0 auto;
  will-change: transform;
  animation: bn-marquee var(--bn-speed) linear infinite;
}
.bn-list {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0 0 0 14px;
  list-style: none;
}
.bn-item {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  max-width: min(560px, 78vw);
  padding: 0 24px 0 0;
  white-space: nowrap;
}
.bn-item::after { width: 4px; height: 4px; flex: 0 0 auto; margin-left: 10px; border-radius: 50%; background: #cbd2d9; content: ''; }
.bn-new {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 3px;
  color: #b42318;
  background: #fff0ee;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bn-time { flex: 0 0 auto; color: var(--bn-muted); font-size: .72rem; }
.bn-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
}
.bn-link:hover { color: var(--bn-accent); }
.bn-link:focus-visible { border-radius: 2px; outline: 2px solid var(--bn-accent); outline-offset: 3px; }
.bn-ticker:hover .bn-track, .bn-ticker:focus-within .bn-track,
.bn-ticker.is-paused .bn-track { animation-play-state: paused; }
.bn-ticker.is-paused .bn-toggle .bn-ico-pause { display: none; }
.bn-ticker.is-paused .bn-toggle .bn-ico-play { display: inline; }
.bn-ticker.is-paused .bn-dot { animation-play-state: paused; }
@keyframes bn-marquee { to { transform: translateX(-50%); } }
@keyframes bn-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .65); }
  70%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}
@media (max-width: 575.98px) {
  .bn-ticker { min-height: 44px; border-radius: 6px; }
  .bn-label { gap: 6px; padding: 0 10px; font-size: .68rem; }
  .bn-bolt { width: 15px; height: 15px; }
  .bn-count { min-width: 18px; height: 18px; }
  .bn-toggle { width: 24px; height: 24px; }
  .bn-viewport { margin-left: 4px; }
  .bn-item { gap: 6px; max-width: 78vw; padding-right: 18px; }
  .bn-link { font-size: .8rem; }
  .bn-time { font-size: .66rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bn-track, .bn-dot { animation: none !important; }
  .bn-track { transform: none; }
  .bn-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .bn-list[aria-hidden="true"] { display: none; }
  .bn-item { max-width: min(100%, 78vw); }
}

/* =====================================================================
   TITRE DE CATÉGORIE
   ===================================================================== */
@keyframes title-in {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes hr-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.category-title h1 { animation: title-in .8s var(--anim-ease) both .2s; }
.category-title .hr-after { animation: hr-grow .7s var(--anim-ease) both .55s; }

/* Titres de mots (découpés par JS) */
.split-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(.6em) rotateX(-40deg);
  transform-origin: bottom;
  animation: word-in .7s var(--anim-ease) forwards;
  animation-delay: calc(var(--w, 0) * 45ms + 150ms);
}
@keyframes word-in {
  to { opacity: 1; transform: none; }
}

/* =====================================================================
   APPARITION AU DÉFILEMENT (activée par JS)
   ===================================================================== */
.anim-ready [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(4px);
  transition:
    opacity .8s var(--anim-ease),
    transform .8s var(--anim-ease),
    filter .8s var(--anim-ease);
  transition-delay: var(--reveal-delay, 0s);
}
.anim-ready [data-reveal="left"]  { transform: translateX(-30px); }
.anim-ready [data-reveal="zoom"]  { transform: scale(.94); }
.anim-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Entrée plus légère des cartes éditoriales : la photo ne se dévoile pas en rideau. */
.anim-ready .latest-post article[data-reveal] {
  transform: translateY(22px);
  filter: blur(1px);
  transition-duration: .65s;
}
.anim-ready .latest-post article[data-reveal].is-visible { transform: none; }
.anim-ready .latest-post article[data-reveal] .image-wrapper {
  clip-path: none;
  transition: none;
}

/* Image révélée par un rideau */
.anim-ready [data-reveal] .image-wrapper {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s var(--anim-ease);
  transition-delay: calc(var(--reveal-delay, 0s) + .15s);
}
.anim-ready [data-reveal].is-visible .image-wrapper {
  clip-path: inset(0 0 0 0);
}

/* =====================================================================
   CARTES D'ARTICLES : interactions sobres, lisibles et accessibles
   ===================================================================== */
.latest-post .card.hover-a,
.related-post .card.hover-a,
.block-area article.card.hover-a {
  --article-ease: cubic-bezier(.2, .75, .25, 1);
  border-radius: .5rem;
  transition: transform .35s var(--article-ease), box-shadow .35s var(--article-ease), background-color .35s ease;
}
.latest-post .card.hover-a { overflow: hidden; background: #fff; }
.latest-post .card.hover-a .card-body { padding-left: .75rem; padding-right: .75rem; }
.latest-post .card.hover-a:hover,
.latest-post .card.hover-a:focus-within,
.related-post .card.hover-a:hover,
.related-post .card.hover-a:focus-within,
.block-area article.card.hover-a:hover,
.block-area article.card.hover-a:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -22px rgba(18, 30, 45, .58), 0 3px 10px rgba(18, 30, 45, .07);
}

.hover-a .image-wrapper { position: relative; overflow: hidden; }
.hover-a .image-wrapper img {
  transition: transform .7s var(--anim-ease), filter .5s ease, opacity .4s ease;
}
.latest-post .hover-a .image-wrapper img.loaded,
.related-post .hover-a .image-wrapper img.loaded,
.block-area article.hover-a .image-wrapper img.loaded { transform: scale(1.001); }
.latest-post .hover-a:hover .image-wrapper img.loaded,
.latest-post .hover-a:focus-within .image-wrapper img.loaded,
.related-post .hover-a:hover .image-wrapper img.loaded,
.related-post .hover-a:focus-within .image-wrapper img.loaded,
.block-area article.hover-a:hover .image-wrapper img.loaded,
.block-area article.hover-a:focus-within .image-wrapper img.loaded {
  transform: scale(1.045);
  filter: saturate(1.06);
}

.hover-a .card-title a {
  background-image: none !important;
  text-decoration: none !important;
  text-decoration-line: none !important;
  transition: color .22s ease;
}
.hover-a:hover .card-title a,
.hover-a:focus-within .card-title a { color: var(--anim-primary-dark); }
.hover-a .card-title a:focus-visible { outline: 2px solid var(--anim-primary-dark); outline-offset: 3px; }

/* Aide visuelle sur la une, sans voile ni badge intrusif. */
.latest-post .hover-a .image-wrapper::before {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(12, 20, 30, .32), transparent);
  opacity: 0;
  transition: opacity .35s ease;
}
.latest-post .hover-a:hover .image-wrapper::before,
.latest-post .hover-a:focus-within .image-wrapper::before { opacity: 1; }

/* Barre latérale : glissement léger */
.widget .card.hover-a { transition: transform .4s var(--anim-ease); }
.widget .card.hover-a:hover { transform: translateX(6px); }

/* Mobile : privilégier le scroll, éviter les états hover qui restent bloqués au toucher. */
@media (max-width: 767.98px) {
  .anim-ready .latest-post article[data-reveal] {
    transform: translateY(14px);
    filter: none;
    transition-duration: .45s;
    transition-delay: calc(var(--reveal-delay, 0s) * .55);
  }

  .latest-post .card.hover-a,
  .related-post .card.hover-a,
  .block-area article.card.hover-a {
    border-radius: .4rem;
    transition-duration: .22s;
    box-shadow: 0 2px 10px rgba(18, 30, 45, .045);
  }

  .latest-post .card.hover-a:hover,
  .latest-post .card.hover-a:focus-within,
  .related-post .card.hover-a:hover,
  .related-post .card.hover-a:focus-within,
  .block-area article.card.hover-a:hover,
  .block-area article.card.hover-a:focus-within {
    transform: none;
    box-shadow: 0 3px 12px rgba(18, 30, 45, .08);
  }

  .latest-post .hover-a .image-wrapper img,
  .related-post .hover-a .image-wrapper img,
  .block-area article.hover-a .image-wrapper img {
    transform: none !important;
    filter: none !important;
    transition: opacity .25s ease;
  }

  .widget .card.hover-a:hover { transform: none; }
  .hover-a .card-title a:active { color: var(--anim-primary-dark); }
}

@media (hover: none) and (pointer: coarse) {
  .latest-post .card.hover-a:hover,
  .related-post .card.hover-a:hover,
  .block-area article.card.hover-a:hover { transform: none; }
}

/* =====================================================================
   PAGE ARTICLE
   ===================================================================== */
/* Barre de progression de lecture */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1080;
  width: 100%;
  height: 4px;
  pointer-events: none;
}
.reading-progress span {
  position: relative;
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--anim-primary), #ff7a00);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  box-shadow: 0 0 10px rgba(255, 122, 0, .6);
}

/* Bouton retour en haut avec anneau de progression */
.back-top {
  transition: transform .3s var(--anim-spring), opacity .3s;
}
.back-top:hover { transform: translateY(-4px); }
.back-top .progress-ring {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  pointer-events: none;
  transform: rotate(-90deg);
}
.back-top .progress-ring circle {
  fill: none;
  stroke: var(--anim-primary);
  stroke-width: 3;
  stroke-linecap: round;
}

/* En-tête */
.post-title .post-atribute { animation: title-in .8s var(--anim-ease) both .6s; }

/* Image principale : rideau + parallaxe */
.post-content figure.image-wrapper {
  overflow: hidden;
  border-radius: .5rem;
  animation: hero-curtain 1.2s var(--anim-ease) both .3s;
}
.post-content figure.image-wrapper img {
  transform: translateY(var(--parallax, 0px)) scale(1.12);
  transition: opacity .5s ease-in-out;
  will-change: transform;
}
@keyframes hero-curtain {
  from { clip-path: inset(0 0 100% 0 round .5rem); }
  to   { clip-path: inset(0 0 0 0 round .5rem); }
}
.post-content figure figcaption {
  animation: title-in .7s var(--anim-ease) both 1.1s;
}

/* Intertitres : barre d'accent qui se dessine */
.post-content h2, .post-content h3, .post-content h4 {
  position: relative;
  padding-left: .9rem;
}
.post-content h2::before, .post-content h3::before, .post-content h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: .15em;
  bottom: .15em;
  width: 4px;
  border-radius: 4px;
  background: var(--anim-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .7s var(--anim-ease) .3s;
}
.post-content .is-visible::before,
.post-content h2:not([data-reveal])::before,
.post-content h3:not([data-reveal])::before,
.post-content h4:not([data-reveal])::before { transform: scaleY(1); }

.post-content blockquote {
  border-left: 4px solid var(--anim-primary);
  padding-left: 1rem;
}

/* Liens dans le texte */
.post-content p a {
  background-image: linear-gradient(rgba(242, 181, 20, .35), rgba(242, 181, 20, .35));
  background-size: 100% 0;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .3s var(--anim-ease);
}
.post-content p a:hover { background-size: 100% 100%; }

/* Tags */
.tags-links li a {
  transition: transform .3s var(--anim-spring), background-color .25s, color .25s, box-shadow .3s;
}
.tags-links li a:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .4);
}

/* =====================================================================
   ACCESSIBILITÉ
   ===================================================================== */
@media (hover: none) {
  .latest-post .hover-a .image-wrapper::after,
  .latest-post .hover-a .image-wrapper::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .anim-ready [data-reveal],
  .anim-ready [data-reveal] .image-wrapper,
  .split-word { opacity: 1; transform: none; filter: none; clip-path: none; }
  .post-content figure.image-wrapper img { transform: none; }
}
