/* Ajouts : bouton Réserver (grand écran), sélecteur de langue, menu sans flèches,
   rangées de cartes avec flèches,
   tuiles de types d’événements, cartes de livres. Complète components.css. */

.header-book {
  display: none;
}

@media (min-width: 64em) {
  .header-book {
    display: inline-block;
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.6rem 1.1rem;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.3s var(--ease);
  }

  .header-book:hover {
    background: var(--color-primary-dark);
    color: var(--color-on-primary);
  }
}

/* Menu à droite, langue à gauche, sur mobile */
.nav-toggle {
  left: auto;
  right: 0.75rem;
}

/* Sélecteur de langue */
.lang-switch {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.lang-switch a {
  padding: 0.3rem 0.25rem;
  color: var(--color-muted);
  text-decoration: none;
}

.lang-switch a[aria-current="true"] {
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
}

.lang-switch__sep {
  color: var(--color-line);
}

@media (min-width: 64em) {
  .lang-switch {
    left: 2rem;
  }
}

/* Menu sans flèches : sur mobile, les sous-menus sont toujours affichés */
.nav__sub-toggle {
  display: none !important;
}

@media (max-width: 63.99em) {
  .nav__item {
    display: block;
  }

  .nav__item .subnav {
    display: block;
    padding: 0 0 0.9rem 0;
  }

  .nav__link {
    padding-bottom: 0.4rem;
  }
}

/* Rangées de cartes : la dernière carte est coupée pour montrer qu’il y en a d’autres */
.card-row {
  scrollbar-width: none;
  grid-auto-columns: 78%;
}

.card-row::-webkit-scrollbar {
  display: none;
}

@media (min-width: 40em) {
  .card-row {
    grid-auto-columns: 44%;
  }
}

@media (min-width: 64em) {
  .card-row {
    grid-auto-columns: calc((100% - 3 * 1.5rem) / 3.35);
  }
}

.card-row-wrap {
  position: relative;
}

.card-row__btn {
  position: absolute;
  top: 28%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 10px 24px -14px rgba(35, 40, 46, 0.5);
  cursor: pointer;
  transition: opacity 0.25s var(--ease), background-color 0.25s var(--ease);
}

.card-row__btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.card-row__btn[disabled] {
  opacity: 0;
  pointer-events: none;
}

.card-row__btn--prev {
  left: -1.1rem;
}

.card-row__btn--next {
  right: -1.1rem;
}

@media (max-width: 39.99em) {
  .card-row__btn {
    display: none;
  }
}

.card__short {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}

/* Tuiles de types d’événements */
.event-types {
  list-style: none;
  margin: 0 0 3rem;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.event-type-tile {
  display: block;
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-accent);
  text-decoration: none;
  color: var(--color-ink);
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

/* Survol : fond clair, le cadre ne change pas */
.event-type-tile:hover {
  background: var(--card-hover);
  box-shadow: 0 18px 34px -26px rgba(35, 40, 46, 0.4);
  transform: translateY(-2px);
  color: var(--color-ink);
}

.event-type-tile__title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.event-type-tile__count {
  display: block;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.event-type-tile.is-empty {
  opacity: 0.6;
}

/* Page Livres (livres.php)
   1. L'édition dans la langue de la page en grand (couverture à gauche, texte à droite),
      l'autre en plus petit dessous, sous un filet. Empilé et centré sur mobile.
   2. Bande teintée : photos des pages intérieures et texte sur le livre */
.book-editions {
  max-width: 50rem;
  margin-inline: auto;
}

.book-edition {
  display: grid;
  gap: 1.5rem 3rem;
  justify-items: center;
  text-align: center;
}

.book-edition--other {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-line);
  gap: 1.25rem 1.75rem;
}

@media (min-width: 700px) {
  .book-edition {
    grid-template-columns: 17rem minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
  }
  .book-edition--other {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    align-items: start;
  }
  .book-edition--no-cover { grid-template-columns: 1fr; }
  .book-edition .book-edition__stores ul { justify-content: flex-start; }
}

.book-edition__cover {
  display: block;
  width: 100%;
  max-width: 17rem;
  box-shadow: 0 2px 4px rgba(35, 40, 46, 0.1), 0 18px 36px -12px rgba(35, 40, 46, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-edition--other .book-edition__cover {
  max-width: 6.5rem;
  box-shadow: 0 1px 2px rgba(35, 40, 46, 0.12), 0 8px 18px -6px rgba(35, 40, 46, 0.3);
}

.book-edition__cover:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(35, 40, 46, 0.1), 0 24px 40px -12px rgba(35, 40, 46, 0.4);
}

.book-edition__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 40 / 52;
  border-radius: 2px 4px 4px 2px;
}

/* Édition principale : la couverture devient un vrai livre, légèrement tourné,
   avec un dos (ombre et reflet à gauche) et un halo bleu de la couleur de la couverture.
   Au survol, le livre se tourne vers le lecteur. */
.book-edition--main .book-edition__cover {
  position: relative;
  margin: 1rem 0;
  border-radius: 2px 4px 4px 2px;
  transform: perspective(1400px) rotateY(-14deg);
  transform-origin: 30% 50%;
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.6) inset,
    6px 6px 0 -2px #f4f1ea,
    7px 7px 0 -2px rgba(35, 40, 46, 0.12),
    0 30px 50px -18px rgba(28, 64, 100, 0.55);
  transition: transform 0.6s cubic-bezier(.2, .7, .2, 1), box-shadow 0.6s ease;
}

.book-edition--main .book-edition__cover:hover {
  transform: perspective(1400px) rotateY(-3deg) translateY(-6px);
}

/* Halo derrière le livre */
.book-edition--main .book-edition__cover::before {
  content: "";
  position: absolute;
  inset: -18% -30%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(61, 122, 168, 0.28), rgba(61, 122, 168, 0) 70%);
  filter: blur(8px);
  pointer-events: none;
}

/* Dos du livre : pli et reflet le long du bord gauche */
.book-edition--main .book-edition__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0.22) 0,
    rgba(255, 255, 255, 0.22) 1.5%,
    rgba(0, 0, 0, 0.12) 3%,
    rgba(0, 0, 0, 0) 7%,
    rgba(255, 255, 255, 0.06) 60%,
    rgba(0, 0, 0, 0.06) 100%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .book-edition--main .book-edition__cover,
  .book-edition--main .book-edition__cover:hover { transition: none; }
}

.book-edition__desc {
  max-width: 30rem;
  margin: 0 0 1.75rem;
  line-height: 1.7;
}

.book-edition__lang {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 0.6rem;
}

.book-edition__title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}

/* Autre édition : tout en plus petit */
.book-edition--other .book-edition__title {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.book-edition--other .book-edition__authors {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.book-edition--other .book-edition__buy {
  margin-bottom: 0.9rem;
}

.book-edition__authors {
  color: var(--color-muted);
  margin: 0 0 1.5rem;
}

.book-edition__buy {
  margin: 0 0 1.25rem;
}

.book-edition__stores {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.book-edition__stores p {
  margin: 0 0 0.35rem;
}

.book-edition__stores ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Bande « Au fil des pages » : photos à gauche, texte à droite */
.books-inside__grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.books-inside__grid--no-photo {
  max-width: 40rem;
  margin-inline: auto;
}

@media (min-width: 860px) {
  .books-inside__grid:not(.books-inside__grid--no-photo) {
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(3rem, 6vw, 5rem);
  }
}

/* Titre discret : la phrase du livre est le vrai titre visuel */
.books-inside__head {
  margin: 0 0 1.25rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.books-quote {
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
}

.books-quote p {
  margin: 0;
  /* Cormorant italique, comme « Réserver » et la newsletter (exception voulue aux titres Josefin) */
  font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.3;
  color: var(--color-ink);
  text-wrap: balance;
}

/* Photos 48 (carrée) et 54 (3:4) qui se chevauchent, comme deux tirages posés l'un sur l'autre :
   la 54, avec un cadre blanc, recouvre le coin bas droit de la 48 */
.books-photos {
  position: relative;
  width: 100%;
  max-width: 32rem;
  margin-inline: auto;
}

.books-photos__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.books-photos__img--48 {
  aspect-ratio: 1 / 1;
  width: 76%;
  margin-bottom: 30%;
  box-shadow: 0 14px 30px -14px rgba(35, 40, 46, 0.35);
}

.books-photos__img--54 {
  aspect-ratio: 3 / 4;
  width: 48%;
  position: absolute;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  border: 0.45rem solid #fff;
  box-shadow: 0 18px 36px -12px rgba(35, 40, 46, 0.4);
}

/* Une seule photo : pleine largeur, sans chevauchement */
.books-photos__img:only-child {
  position: static;
  width: 100%;
  margin: 0;
  border: 0;
}
