/* ========================================
   PAGE BOOKS (/books)
   Haut de page : styles de la page À propos (a-propos.css) ; haut de page agrandi sur tablette
   et mobile, filtres, menu déroulant, pagination : styles de la page Blog (blog-list.css, classe
   blog-list-page sur le body). Ici : une rangée par book, photo et texte en alternance.
   Réglages : admin « Page Books » ; couvertures par écran : admin Books, bouton « Formats ».
   ======================================== */

/* Ordinateur : photo du haut sur tout l'écran (sous l'en-tête), la liste commence plus bas et l'image
   se voit en entier ; textes centrés en hauteur ; fondu vers le vert limité au bas de la
   photo (22 %) */
@media (min-width: 1200px) {
  .books-list-page .about-hero:has(.about-hero-media) {
    min-height: calc(100vh - var(--site-header-h, 76px));
    min-height: calc(100svh - var(--site-header-h, 76px));
  }

  .books-list-page .about-hero::after {
    height: 22%;
  }
}

/* Mobile : photo du haut sur tout l'écran, la liste arrive au défilement. Textes
   centrés dans les 59 % du haut de l'écran (un peu plus haut que /projets, demande de Max) */
@media (max-width: 767px) {
  .books-list-page .about-hero:has(.about-hero-media) {
    align-items: flex-start;
    min-height: calc(100vh - var(--site-header-h, 76px));
    min-height: calc(100svh - var(--site-header-h, 76px));
  }

  .books-list-page .about-hero:has(.about-hero-media) .about-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(59vh - var(--site-header-h, 76px));
    min-height: calc(59svh - var(--site-header-h, 76px));
  }

  .books-list-page .about-hero::after {
    height: 22%;
  }
}

/* Filtres seuls (pas de recherche) : alignés à gauche */
.books-list-page .pl-toolbar {
  justify-content: flex-start;
}

.bk-rows {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 6vw, 96px);
}

.bk-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 4.5vw, 72px);
}

/* Une rangée sur deux : la photo à droite */
.bk-row.is-reverse .bk-media {
  order: 2;
}

/* ---- Photo (couverture par écran) : un clic ouvre la galerie ---- */
.bk-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(145deg, #1f3a2e, #142820);
  border: 1px solid rgba(157, 198, 107, 0.16);
  border-radius: 20px;
  box-shadow: 0 40px 70px -44px rgba(0, 0, 0, 0.9);
  cursor: zoom-in;
  isolation: isolate;
}

.bk-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-media:hover img,
.bk-media:focus-visible img {
  transform: scale(1.05);
}

.bk-media:focus-visible {
  outline: 2px solid var(--site-lime);
  outline-offset: 4px;
}

/* Nombre de photos : pastille verre en bas à gauche */
.bk-count {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-family: var(--site-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
  background: rgba(16, 32, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.bk-count svg {
  width: 16px;
  height: 16px;
  color: var(--site-lime);
}

/* Pictogramme « agrandir » en haut à droite */
.bk-open {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(16, 32, 26, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-open svg {
  width: 16px;
  height: 16px;
}

.bk-media:hover .bk-open,
.bk-media:focus-visible .bk-open {
  color: var(--site-green-deep, #10201a);
  background: var(--site-lime);
  border-color: var(--site-lime);
  transform: scale(1.06);
}

/* ---- Texte ---- */
.bk-body {
  min-width: 0;
}

.books-list-page .bk-category {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-family: var(--site-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--site-lime);
}

.books-list-page .bk-category::after {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.books-list-page .bk-title {
  margin: 0;
  font-family: var(--site-serif);
  font-size: clamp(26px, 2.2vw, 34px);
  font-weight: 600;
  line-height: 1.1;
  color: #fff;
}

.books-list-page .bk-text {
  display: -webkit-box;
  margin: 14px 0 0;
  overflow: hidden;
  font-family: var(--site-sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/* Vignettes : les premières photos de la galerie, un clic l'ouvre à cette photo */
.bk-thumbs {
  display: flex;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.bk-thumb {
  position: relative;
  display: block;
  width: 84px;
  height: 84px;
  padding: 0;
  overflow: hidden;
  background: #152a21;
  border: 1px solid rgba(157, 198, 107, 0.2);
  border-radius: 12px;
  cursor: zoom-in;
  transition: border-color 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bk-thumb:hover {
  border-color: var(--site-lime);
  transform: translateY(-3px);
}

.bk-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--site-sans);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: rgba(16, 32, 26, 0.65);
}

/* Boutons */
.bk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 26px;
}

.bk-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  font-family: var(--site-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--site-green-deep, #10201a);
  background: var(--site-lime);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.bk-btn svg {
  width: 17px;
  height: 17px;
}

.bk-btn:hover {
  background: #b5d68c;
}

.bk-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--site-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--site-lime);
}

.bk-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-link:hover {
  color: #fff;
}

.bk-link:hover svg {
  transform: translateX(5px);
}

.bk-thumb:focus-visible,
.bk-btn:focus-visible,
.bk-link:focus-visible {
  outline: 2px solid var(--site-lime);
  outline-offset: 3px;
}

/* ========================================
   TABLETTE ET MOBILE (tailles alignées sur le reste du site)
   ======================================== */
@media (max-width: 1199px) {
  .books-list-page .bk-title {
    font-size: 26px;
  }

  .books-list-page .bk-text {
    font-size: 14.5px;
  }

  .bk-thumb {
    width: 72px;
    height: 72px;
  }
}

/* Tablette : la photo en grand sur toute la largeur, le texte dessous */
@media (max-width: 991px) {
  .bk-rows {
    gap: 56px;
  }

  .bk-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .bk-row.is-reverse .bk-media {
    order: 0;
  }

  .books-list-page .bk-title {
    font-size: 24px;
  }

  .books-list-page .bk-text {
    font-size: 14px;
    -webkit-line-clamp: 3;
  }
}

/* Mobile : photo en portrait (image mobile de l'admin « Formats » si elle existe) */
@media (max-width: 575px) {
  .bk-rows {
    gap: 44px;
  }

  .bk-row {
    gap: 18px;
  }

  .bk-media {
    aspect-ratio: 4 / 5;
    border-radius: 14px;
  }

  .bk-count {
    bottom: 12px;
    left: 12px;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .bk-open {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .books-list-page .bk-category {
    font-size: 11px;
  }

  .books-list-page .bk-title {
    font-size: 21px;
  }

  .books-list-page .bk-text {
    margin-top: 10px;
    font-size: 13.5px;
  }

  .bk-thumbs {
    gap: 8px;
    margin-top: 16px;
  }

  .bk-thumb {
    width: 62px;
    height: 62px;
    border-radius: 10px;
  }

  .bk-actions {
    gap: 12px 20px;
    margin-top: 18px;
  }

  .bk-btn {
    height: 42px;
    padding: 0 18px;
    font-size: 11.5px;
  }

  .bk-link {
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bk-media img,
  .bk-thumb,
  .bk-open,
  .bk-link svg {
    transition: none;
  }
}
