/*
 * Slider "Actus" de la page d'accueil — shortcode [csj_actus_slider].
 * Voir inc/actus-slider.php.
 *
 * Reprend à l'identique le rendu de l'ancien [psac_post_slider design="design-2"]
 * (CSS du plugin Post Slider and Carousel 3.2.10 + Owl Carousel + surcharges du
 * thème), avec des classes propres au thème : aucune mise à jour de plugin ne
 * peut plus l'affecter.
 *
 * Points de rupture repris du thème (scss/_breakpoints.scss) :
 * 1180px (tablette), 880px (mobile), 745px (mobileCarousel).
 */

/* Conteneur ------------------------------------------------------------- */

.csj-actus {
  clear: both;
  margin-top: 14rem;
}

.csj-actus::before,
.csj-actus::after {
  content: "";
  display: table;
}

.csj-actus::after {
  clear: both;
}

.csj-actus__slider {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-bottom: 30px;
  -webkit-tap-highlight-color: transparent;
}

.csj-actus__viewport {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.csj-actus__track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.25s ease;
}

.csj-actus__track.is-dragging {
  transition: none;
  user-select: none;
}

/* Diapositive : texte à droite, image à gauche */

.csj-actus__slide {
  position: relative;
  isolation: isolate;
  flex: 0 0 100%;
  min-width: 0;
  min-height: 1px;
  display: flex;
  flex-flow: row-reverse;
}

/* Colonne texte ---------------------------------------------------------- */

.csj-actus__text {
  position: relative;
  width: 70%;
  padding-left: 4rem;
  padding-right: 4rem;
  background-image: url("../img/actus-dots.png");
  background-position: 3px 3px;
  background-repeat: repeat;
}

/* Aplat beige qui déborde sous l'image */
.csj-actus__text::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 110%;
  height: 92%;
  background: #ccc6aa;
  z-index: -1;
}

/* Filigrane */
.csj-actus__text::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 38%;
  height: 92%;
  background-image: url("../img/filigrame.png");
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: -1;
}

.csj-actus__overlay {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0;
}

.csj-actus__title {
  margin: 0.4rem 0 0 !important;
  font-size: 24px;
  line-height: 30px;
}

.csj-actus__title a {
  color: #93895e;
  font-size: 2rem;
  font-weight: 500;
  line-height: 2rem;
  text-decoration: none !important;
  border-bottom: 0 !important;
}

.csj-actus__meta {
  margin: 0 0 15px;
  color: #555;
  font-size: 12px;
  line-height: normal !important;
  text-transform: uppercase;
}

.csj-actus__date {
  display: flex;
  margin: 2.5rem 5px 5px;
  color: #504e4a;
  font-size: 2rem;
  font-style: italic;
  font-weight: 500;
}

.csj-actus__excerpt {
  margin-top: 2.5rem;
  margin-bottom: 15px;
  color: #504e4a;
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
}

.csj-actus__more {
  display: block;
  float: right;
  box-sizing: border-box;
  margin-top: 2.5rem;
  padding: 8px 15px;
  border: 2px solid #888;
  color: #93895e;
  font-size: 1.2rem;
  font-weight: 300 !important;
  line-height: normal !important;
  text-decoration: none !important;
  text-transform: uppercase;
  transition: all 0.5s ease-out;
}

.csj-actus__more:hover,
.csj-actus__more:focus-visible {
  background: #93895e;
  color: #fff;
}

/* Colonne image ---------------------------------------------------------- */

.csj-actus__media {
  position: relative;
  padding-top: 6rem;
}

.csj-actus__media-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.csj-actus__image {
  position: relative;
  width: 39rem;
  height: 32rem;
  background-color: #f1f1f1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Navigation "Autres actus" ---------------------------------------------- */

.csj-actus__nav {
  position: absolute;
  top: 11rem;
  left: 46.5rem;
  width: 10.8rem;
  margin-top: -30px;
  transform: translateY(-50%);
}

.csj-actus__nav::before {
  content: "Autres actus";
  position: relative;
  top: -0.4rem;
  left: 1.3rem;
  color: #504e4a;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.csj-actus__nav button {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0;
  display: block;
  margin: 0;
  padding: 2px 15px 4px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #000;
  font: inherit;
  font-size: 0;
  line-height: normal;
  cursor: pointer;
  user-select: none;
}

.csj-actus__nav button[disabled] {
  display: none;
}

.csj-actus__prev {
  left: 0;
}

.csj-actus__next {
  right: 0;
}

.csj-actus__nav button span::before {
  content: "";
  position: absolute;
  top: 0;
  width: 1rem;
  height: 1rem;
}

.csj-actus__prev span::before {
  left: 0;
  background-image: url("../img/left-arrow.svg");
}

.csj-actus__next span::before {
  right: -0.3rem;
  background-image: url("../img/right-arrow.svg");
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1180px) {
  .csj-actus__image {
    width: 24rem;
  }

  .csj-actus__nav {
    left: 29.5rem;
  }
}

@media (max-width: 880px) {
  .csj-actus__image {
    width: 17rem;
  }

  .csj-actus__nav {
    left: 22.5rem;
  }
}

@media (max-width: 745px) {
  .csj-actus {
    margin-top: 0;
  }

  .csj-actus__slide {
    flex-flow: column;
    align-items: flex-start;
  }

  .csj-actus__text {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .csj-actus__text::before,
  .csj-actus__text::after {
    width: 100%;
    height: 145%;
  }

  .csj-actus__title a,
  .csj-actus__date {
    font-size: 1.4rem;
  }

  .csj-actus__media {
    padding-top: 0;
  }

  .csj-actus__image {
    width: 20rem;
    height: 20rem;
    margin-top: 3rem;
  }

  /* "top" reste à 11rem : l'ancien 9.5rem du thème n'a jamais été appliqué (écrasé par un !important). */
  .csj-actus__nav {
    left: 1rem;
    width: 9.6rem;
  }

  .csj-actus__nav::before {
    top: -0.25rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .csj-actus__track,
  .csj-actus__more {
    transition: none;
  }
}
