/**
 * Retouches du thème albin_michel, branchées sur les rôles `--u-*`.
 *
 * Chargé après public/dist/main.css : à spécificité égale, ces règles
 * l'emportent. On ne réécrit que couleurs, typographie et formes ; la mise
 * en page reste celle du thème parent.
 */

/* Conteneur hérité .wrapper : pleine largeur, gouttière fluide.
   La gouttière est une marge et non un remplissage : beaucoup d'éléments
   hérités sont placés en absolu (right: 0) par rapport au .wrapper, ils
   s'alignent ainsi sur le bord du contenu. */
.wrapper {
  box-sizing: border-box;
  width: calc(100% - 2 * var(--page-gutter));
  max-width: calc(var(--page-max) - 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: 0;
}
.wrapper .wrapper,
.Article.teaser > .wrapper {
  width: auto;
  max-width: none;
}
/* Vignette d'article : son .wrapper n'est pas un conteneur de page, il
   prend toute la cellule (sinon une colonne étroite le réduit à rien). */
.Article.teaser > .wrapper {
  margin-inline: 0;
}

/* Fil d'Ariane : sur la même largeur que le contenu */
.Breadcrumbs {
  box-sizing: border-box;
  width: calc(100% - 2 * var(--page-gutter));
  max-width: calc(var(--page-max) - 2 * var(--page-gutter));
  margin-inline: auto;
  padding: 24px 0;
}
.Breadcrumbs ul {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Titre des pages de rubrique : sous le fil d'Ariane, plus en absolu à
   droite (il débordait de la gouttière) */
.Categories .wrapper {
  padding-top: 0;
}
.Categories h1,
.Categories .taxonomy-term > .wrapper > h1 {
  position: static;
  margin: 0 0 40px;
  color: var(--u-ink);
  font-size: clamp(34px, 4vw, 60px);
  font-weight: var(--u-title-weight);
  line-height: 1.05;
  text-align: left;
}

/* Page */
body {
  background-color: var(--u-surface);
  color: var(--u-ink);
  font-family: var(--u-font-base);
}

h1, h2, h3, h4,
.title {
  font-family: var(--u-font-title);
  text-transform: var(--u-title-transform);
}

:focus-visible {
  outline: 2px solid var(--u-focus);
  outline-offset: 3px;
}

/* Bouton */
.Button,
.loadMore button {
  background-color: var(--u-accent);
  color: var(--u-on-accent);
  border-radius: var(--u-button-radius);
}
.Button:active,
.loadMore button:active {
  background-color: var(--u-accent-strong);
}

/* Menu déroulant et menu utilisateur */
.Menu {
  border-top-color: var(--u-accent);
}
.Menu a:hover,
.Menu a:focus-visible {
  color: var(--u-accent-strong);
}

/* Fil d'Ariane */
.Breadcrumbs {
  color: var(--u-ink-muted);
}
.Breadcrumbs strong {
  color: var(--u-accent-strong);
}
.Breadcrumbs a:hover,
.Breadcrumbs a:focus {
  color: var(--u-ink);
}

/* En-tête de rubrique */
.PageTitle {
  background-color: var(--u-band-bg);
}
.PageTitle h1 {
  color: var(--u-band-title);
}

/* Rubriques (taxonomy-term--book-category) */
.Categories h1 {
  color: var(--u-accent);
}
.Categories h2 a {
  color: var(--u-ink);
  transition: color 0.15s;
}
.Categories h2 a:hover {
  color: var(--u-accent);
}
.Categories-sub--title {
  border-bottom-color: var(--u-rule);
}
.Categories-link-more {
  color: var(--u-ink);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.Categories-link-more:hover {
  color: var(--u-accent-strong);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Carrousels */
.carousel-arrow-prev svg,
.carousel-arrow-next svg {
  fill: var(--u-ink-muted);
  transition: fill 0.15s;
}
.carousel-arrow-prev:hover svg,
.carousel-arrow-next:hover svg {
  fill: var(--u-accent);
}
.carousel-pagination .swiper-pagination-bullet.swiper-pagination-bullet-active {
  background-color: var(--u-accent);
}

/* Fiche livre en liste */
.BookTeaser .BookTeaser-title,
.BookTeaser .BookTeaser-title a,
.BookTeaser .BookTeaser-title a:hover {
  color: var(--u-book-title);
}
.BookTeaser .BookTeaser-author,
.BookTeaser .BookTeaser-authors,
.BookTeaser .BookTeaser-authors a {
  color: var(--u-ink-muted);
}
.BookTeaser .BookTeaser-authors a:hover {
  color: var(--u-ink);
}
.BookTeaser .BookTeaser-tobereleased {
  background-color: var(--u-accent);
  color: var(--u-on-accent);
}
/* Couverture qui s'ouvre au survol, sur les cartes des accueils d'univers
   seulement (les vignettes BookTeaser restent fixes) : elle pivote sur son
   dos (bord gauche), laisse voir une première page posée dessous, et son
   coin bas droit se corne comme une page qu'on tourne.
   - .BookOpen : enveloppe de la taille exacte de la couverture ; la page
     est son ::before, réduite comme la couverture pour rester alignée au
     dos.
   - .BookCover : ce qui pivote ; son ::after est le rabat du coin corné,
     l'image (ou la vignette « indisponible ») est découpée d'autant. */
@property --cover-fold {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
.BookOpen {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  perspective: 2000px;
}
.BookOpen::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--u-cover-radius);
  /* Papier, bout des lignes de texte sur le bord droit (seule partie
     découverte quand la couverture s'entrouvre), ombre de la tranche */
  background:
    linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent 4%),
    repeating-linear-gradient(to bottom, transparent 0 7px, rgba(0, 0, 0, 0.14) 7px 8px) right 4% top 14% / 11% 72% no-repeat,
    #fbf8f1;
  box-shadow: var(--u-cover-shadow);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.BookCover {
  position: relative;
  display: block;
  transform-origin: left center;
  transition:
    transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.55s ease,
    --cover-fold 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.BookCover img,
.BookCover .CoverPlaceholder {
  display: block;
  border-radius: var(--u-cover-radius);
  box-shadow: var(--u-cover-shadow);
}
/* Rabat : le dos du coin replié, ombré le long du pli */
.BookCover::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--cover-fold);
  height: var(--cover-fold);
  background: linear-gradient(to top left, transparent 50%, #ddd6c8 50%, #fbf8f1 80%);
  filter: drop-shadow(-2px -2px 2px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.UniversCard-link:is(:hover, :focus-visible) .BookCover {
  --cover-fold: 22px;
  transform: rotateY(var(--u-cover-open)) scale(var(--u-cover-scale));
  /* L'ombre suit la forme découpée (l'image, découpée, perd la sienne) */
  filter: drop-shadow(6px 2px 8px rgba(0, 0, 0, 0.28));
}
.UniversCard-link:is(:hover, :focus-visible) .BookCover :is(img, .CoverPlaceholder) {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cover-fold)), calc(100% - var(--cover-fold)) 100%, 0 100%);
}
.UniversCard-link:is(:hover, :focus-visible) .BookOpen::before {
  transform: scale(var(--u-cover-scale));
}
.BookTeaser .BookTeaser-header--actions a:hover svg {
  fill: var(--u-accent);
}

@media (prefers-reduced-motion: reduce) {
  .BookCover,
  .BookOpen::before {
    transition: none;
  }
  .UniversCard-link:is(:hover, :focus-visible) .BookCover {
    transform: none;
  }
}

/* En-tête : le champ de recherche prend le fond de l'univers */
.Header input[type="text"],
.Header input[type="search"] {
  background-color: transparent;
  color: var(--u-ink);
}
.HeaderSearch--panel {
  background-color: var(--u-surface);
  border-top-color: var(--u-accent);
}

/* Aperçu dans le formulaire Univers du BO : la page seule */
body.is-univers-preview {
  padding-left: 0 !important;
}
body.is-univers-preview .am-sidebar {
  display: none !important;
}

/* « Voir plus » des listes (load-more.js, infinite-loader.js du parent) */
.loadMore,
.InfiniteScroll {
  /* Souvent dernier élément de la page : de l'air avant la section ou le
     pied de page qui suit */
  margin: 48px 0 clamp(72px, 9vw, 128px);
  text-align: center;
}
.loadMore button,
.loadMore a,
.InfiniteScroll a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: 52px;
  padding: 0 32px;
  border: 1px solid var(--u-ink);
  border-radius: var(--am-radius);
  background: transparent;
  color: var(--u-ink);
  font-family: var(--u-font-base);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.loadMore button:hover,
.loadMore button:focus-visible,
.loadMore a:hover,
.InfiniteScroll a:hover {
  background: var(--u-ink);
  color: var(--u-surface);
}
.loadMore button:active {
  background: var(--u-ink);
}

/* Bloc d'articles des rubriques (am_author_articles, « A la une ») :
   titre comme les rayons, cartes comme la mosaïque de l'accueil. */
.articles-bloc-title.BooksList-category {
  margin: clamp(72px, 8vw, 120px) 0 32px;
  padding: 0;
  border: 0;
}
.articles-bloc-title h3 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05;
}
.author-articles .Article.teaser {
  height: auto;
  background: none;
}
.author-articles .Article.teaser > .wrapper {
  width: auto;
  max-width: none;
  margin: 0;
}
.author-articles .Article.teaser .article-link {
  display: flex;
  flex-direction: column;
  color: var(--u-ink);
}
.author-articles .Article.teaser .article-illustration {
  overflow: hidden;
  margin-bottom: 14px;
  border-radius: var(--am-radius);
  aspect-ratio: 4 / 3;
}
.author-articles .Article.teaser .article-illustration img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.author-articles .Article.teaser:hover .article-illustration img {
  transform: scale(1.04);
}
.author-articles .Article.teaser .article-etiquette {
  top: 12px;
  left: 12px;
  right: auto;
  padding: 4px 8px;
  border-radius: var(--am-radius);
  background: var(--am-white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.author-articles .Article.teaser .article-content {
  margin: 0;
}
.author-articles .Article.teaser .article-title {
  color: var(--u-ink);
}
.author-articles .Article.teaser .article-title h3 {
  margin: 0;
  font-family: var(--u-font-title);
  font-weight: var(--u-title-weight);
  font-size: 19px;
  line-height: 1.2;
}
.author-articles .Article.teaser .article-chapo {
  margin-top: 8px;
  color: var(--u-ink-muted);
  font-size: 15px;
}
.author-articles .Article.teaser:hover .article-title {
  color: var(--u-accent);
}
@media (prefers-reduced-motion: reduce) {
  .author-articles .Article.teaser .article-illustration img {
    transition: none;
  }
}
