/* Composant limité à l’accueil : aucune règle de composition des diapositives. */
body[data-page="home"] #presentationToggle {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  border-radius: 0;
  padding: 11px 13px;
}

#aes-actualites {
  position: fixed;
  inset: auto 0 26px;
  z-index: 40; /* Sous l’en-tête et son menu mobile. */
  width: 100%;
  height: 15vh;
  height: 15dvh;
  /* Le bandeau et son décalage restent dans les 20 % de la fenêtre. */
  max-height: max(0px, calc(20vh - 26px));
  max-height: max(0px, calc(20dvh - 26px));
  margin: 0;
  border-radius: 0;
  border-top: 1px solid #ddd;
  padding: min(1.5vh, 12px) 0;
  padding-bottom: max(min(1.5vh, 12px), env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: clamp(66px, 7.2vw, 120px) minmax(0, 1fr);
  color: #111;
  background: rgba(255, 255, 255, .94);
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

#aes-actualites[hidden],
#aes-actualites-reopen[hidden],
body[data-presentation-active="true"] #aes-actualites,
body[data-presentation-active="true"] #aes-actualites-reopen {
  display: none;
}

.aes-actus-controls {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #888;
}
.aes-actus-label {
  display: block;
  flex: 0 0 auto;
  margin: 0 4px;
  padding: min(.6vh, 5px) 2px;
  background: #f60;
  color: #fff;
  text-align: center;
  font-size: clamp(10px, .95vw, 15px);
  line-height: 1.15;
  font-weight: 900;
}
.aes-actus-hide {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: min(1vh, 8px);
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 8px;
  font: inherit;
  font-size: clamp(11px, 1.15vw, 16px);
  cursor: pointer;
}
.aes-actus-hide svg { width: 29px; height: 29px; flex-shrink: 1; }
.aes-actus-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 0;
}
.aes-actus-card {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(10px, 1.2vw, 24px);
  padding: 0 clamp(10px, 1.4vw, 24px);
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #888;
}
.aes-actus-card:last-child { border-right: 0; }
.aes-actus-image { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.aes-actus-copy { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.aes-actus-category {
  color: #f60;
  font-size: clamp(10px, 1vw, 16px);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: min(.5vh, 5px);
}
.aes-actus-title {
  margin: 0;
  font-size: clamp(12px, 1.25vw, 20px);
  line-height: 1.15;
  font-weight: 800;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.aes-actus-summary {
  margin: min(.5vh, 5px) 0 0;
  font-size: clamp(11px, 1vw, 16px);
  line-height: 1.15;
  overflow: hidden;
}
.aes-actus-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  font-size: clamp(10px, 1vw, 16px);
  font-weight: 800;
  white-space: nowrap;
}
.aes-actus-date { display: flex; align-items: center; gap: 6px; }
.aes-actus-date svg { width: 18px; height: 18px; }
.aes-actus-arrow { color: #f60; font-size: clamp(22px, 2.5vw, 40px); line-height: .8; }
.aes-actus-mobile-title { display: none; }
#aes-actualites-reopen {
  position: fixed;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  left: 8px;
  z-index: 40;
  border: 1px solid #f60;
  border-radius: 0;
  padding: 9px 12px;
  background: #f60;
  color: #fff;
  font: 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
}
.aes-actus-card:focus-visible,
.aes-actus-hide:focus-visible,
#aes-actualites-reopen:focus-visible { outline: 2px solid #f60; outline-offset: -3px; }

/* Réduire le contenu, jamais augmenter la hauteur du bandeau. */
@media (min-width: 769px) {
  /* Angle contenu dans la colonne de commande et rogné par le bandeau. */
  .aes-actus-controls { position: relative; isolation: isolate; }
  .aes-actus-controls::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: calc(-1 * min(1.5vh, 12px));
    left: 0;
    right: 0;
    height: calc(min(1.5vh, 12px) + 1.15em + min(1.2vh, 10px) + 28px);
    font-size: clamp(10px, .95vw, 15px);
    background: #f60;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    pointer-events: none;
  }
  .aes-actus-label {
    position: relative;
    left: -9px;
    top: 3px;
    margin: 0;
    padding-inline: 0;
    background: transparent;
    font-size: clamp(10px, .95vw, 15px);
    white-space: nowrap;
    transform: rotate(-28deg);
    transform-origin: center;
  }
  .aes-actus-copy { position: relative; justify-content: center; }
  .aes-actus-meta { margin-top: min(1vh, 8px); }
  /* La flèche conserve son ancrage bas, indépendamment du groupe textuel. */
  .aes-actus-arrow { position: absolute; right: 0; bottom: 0; }
  .aes-actus-date { padding-right: clamp(22px, 2.5vw, 40px); }
}

@media (max-height: 800px) {
  .aes-actus-summary { display: none; }
}
@media (max-height: 550px) {
  .aes-actus-category, .aes-actus-meta { display: none; }
  .aes-actus-copy { justify-content: center; }
  .aes-actus-hide svg { display: none; }
}
@media (max-width: 768px) {
  #aes-actualites {
    background: rgba(255, 255, 255, .98);
    grid-template-columns: 66px minmax(0, 1fr);
  }
  .aes-actus-card { display: flex; align-items: center; padding: 0 8px; }
  .aes-actus-image, .aes-actus-category, .aes-actus-summary,
  .aes-actus-meta, .aes-actus-desktop-title { display: none; }
  .aes-actus-mobile-title { display: inline; }
  .aes-actus-title { font-size: clamp(11px, 3vw, 16px); -webkit-line-clamp: 3; }
  .aes-actus-hide { font-size: 11px; padding: 0 5px; }
  .aes-actus-label { font-size: 9px; padding-inline: 0; white-space: nowrap; }
}

/* Le viewport conserve la place et les dimensions de l’ancienne grille. */
.aes-actus-viewport { min-width: 0; min-height: 0; overflow: hidden; }
.aes-actus-viewport .aes-actus-list { display: flex; width: 100%; height: 100%; }
.aes-actus-viewport .aes-actus-card { flex: 0 0 calc(100% / 3); }
.aes-actus-viewport .aes-actus-card:nth-child(3) { border-right: 0; }
.aes-actus-navigation { display: flex; justify-content: center; gap: 10px; flex: 0 0 auto; }
.aes-actus-navigation[hidden] { display: none; }
.aes-actus-navigation button {
  border: 0; padding: 0 5px; background: transparent; color: #111;
  font: 22px/1 Arial, Helvetica, sans-serif; cursor: pointer;
}
.aes-actus-navigation button:focus-visible { outline: 2px solid #f60; }
@media (max-height: 550px) { .aes-actus-navigation button { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .aes-actus-list { transition: none !important; } }
