/* ============================================================
   OUVRAGES.CSS — Page catalogue des livres (mobile-first)
   Breakpoints : 768 / 820 / 992 / 1200
   Police : Roboto uniquement
   Tailles de police : em relatif au body (base.css)
   body : 16px → 24px → 28px → 30px → 22px → 18px
============================================================ */


/* ══════════════════════════════════════════════════════════
   SECTION DERNIÈRE PUBLICATION
══════════════════════════════════════════════════════════ */

.ouv-featured {
  padding: 48px 0 56px;
}

/* ─── Carte mise en avant ─── */
.ouv-fc {
  --fc-cover-w : 150px;
  --fc-gap     : 16px;
  --fc-radius  : 20px;

  position: relative;
  border: 2px solid #111;
  border-radius: 0 var(--fc-radius) 0 var(--fc-radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
}

/* ① Couverture — position absolue par défaut (tablette+) */
.ouv-fc__cover-link {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--fc-cover-w);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ouv-fc__cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(4px 0 20px rgba(0, 0, 0, .7));
  transition: transform .35s ease;
}

.ouv-fc__cover-link:hover .ouv-fc__cover-img {
  transform: scale(1.04);
}

/* ② Section sombre — fond map-bg via var(--fc-bg) */
.ouv-fc__dark {
  background-image: var(--fc-bg);
  background-size: cover;
  background-position: center;
  padding: 20px var(--fc-gap) 24px calc(var(--fc-cover-w) + var(--fc-gap));
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.ouv-fc__badge {
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--btn-blue);
  margin: 0;
}

.ouv-fc__genres {
  font-size: 0.875em;
  color: rgba(0, 0, 0, .55);
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

.ouv-fc__title {
  font-family: var(--font-sans);
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.15;
  margin: 2px 0 0;
}

.ouv-fc__title a {
  color: #111;
  text-decoration: none;
  transition: color .2s;
}
.ouv-fc__title a:hover { color: var(--btn-blue); }

.ouv-fc__subtitle {
  font-family: var(--font-sans);
  font-size: 1em;
  color: rgba(0, 0, 0, .65);
  margin: 0;
  font-weight: 600;
}

.ouv-fc__desc {
  font-size: 1em;
  line-height: 1.75;
  color: rgba(0, 0, 0, .75);
  margin: 4px 0 0;
}

/* ③ Section blanche — prix gauche / bouton droite */
.ouv-fc__white {
  background: #fff;
  border-top: 2px solid #111;
  padding: 12px var(--fc-gap) 12px calc(var(--fc-cover-w) + var(--fc-gap));
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.ouv-fc__price {
  font-size: 1em;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
}

.ouv-fc__btn { font-size: var(--fs-btn); }


/* ══════════════════════════════════════════════════════════
   MOBILE UNIQUEMENT — carte empilée + contenu centré
   max-width: 767px
══════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  .ouv-fc {
    display: flex;
    flex-direction: column;
    /* Le fond map-bg remonte jusqu'à la couverture */
    background-image: var(--fc-bg);
    background-size: cover;
    background-position: center;
  }

  /* Cover : sort du flux absolu, centrée en haut */
  .ouv-fc__cover-link {
    position: relative;
    left: auto; top: auto; right: auto; bottom: auto;
    width: 60%;
    height: auto;
    margin: 0 auto;
    padding: 24px 0 12px;
    z-index: auto;
  }

  .ouv-fc__cover-img {
    height: auto;
  }

  /* Dark : retire background-image (parent l'a) + texte centré */
  .ouv-fc__dark {
    background-image: none;
    padding: 16px var(--fc-gap) 20px var(--fc-gap);
    min-height: auto;
    text-align: center;
    align-items: center;
  }

  /* White : prix et bouton centrés, empilés */
  .ouv-fc__white {
    padding: 14px var(--fc-gap);
    min-height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  /* Autres ouvrages : éléments élargis + centrés */
  .ouv-card__cover-wrap { width: 82%; }

  .ouv-card__body {
    width: 82%;
    text-align: center;
    align-items: center;
  }

  .ouv-card__footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

}


/* ══════════════════════════════════════════════════════════
   SECTION AUTRES OUVRAGES
   Fond transparent — repose sur le fond du body
   Textes en sombre
══════════════════════════════════════════════════════════ */

.ouv-others {
  background: transparent;
  padding: 48px 0 80px;
}

.ouv-others__title {
  font-family: var(--font-sans);
  font-size: 1.375em;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 28px;
  text-align: center;
}

/* ─── Grille — 1 col mobile → 2 col tablette → 3 col desktop ─── */
.ouv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 72px 20px;
}

/* ─── Carte ouvrage ─── */
.ouv-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform .3s ease;
  height: 100%;   /* remplit la cellule de grille pour homogénéiser les hauteurs */
}

.ouv-card:hover { transform: translateY(-4px); }

/* Couverture — 50 % de la colonne, ratio fixe 2:3 pour homogénéité */
.ouv-card__cover-wrap {
  display: block;
  width: 50%;
  aspect-ratio: 2 / 3;   /* toutes les couvertures même hauteur */
  overflow: hidden;
  border-radius: 4px;
  margin: 0 auto 14px;
  text-decoration: none;
  flex-shrink: 0;
}

.ouv-card__cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  transition: transform .4s ease;
}

.ouv-card:hover .ouv-card__cover {
  transform: scale(1.03) translateY(-4px);
}

.ouv-card__cover-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: rgba(0, 0, 0, .08);
  border-radius: 4px;
}

/* Corps texte — même largeur que la couverture */
.ouv-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  width: 50%;
}

.ouv-card__genres {
  font-size: 0.75em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-style: italic;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ouv-card__title {
  font-family: var(--font-sans);
  font-size: 1em;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ouv-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}
.ouv-card__title a:hover { color: var(--btn-blue); }

.ouv-card__subtitle {
  font-size: 0.875em;
  font-weight: 600;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ouv-card__excerpt {
  font-size: 1em;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prix + bouton */
.ouv-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;   /* pousse le footer en bas de la carte quelle que soit la hauteur du contenu */
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, .12);
  width: 100%;
}

.ouv-card__price {
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
}

.ouv-card__buy { font-size: var(--fs-btn); }


/* ══════════════════════════════════════════════════════════
   BREAKPOINTS TABLETTES ET DESKTOP
══════════════════════════════════════════════════════════ */

@media (min-width: 768px) {

  .ouv-featured { padding: 64px 0 72px; }

  .ouv-fc { --fc-cover-w: 240px; --fc-gap: 24px; }

  .ouv-fc__dark {
    padding-top: 30px;
    padding-bottom: 34px;
    gap: 18px;
    min-height: 240px;
  }

  .ouv-fc__white { min-height: 80px; }

  /* Grille 2 cols tablette */
  .ouv-grid { grid-template-columns: 1fr 1fr; gap: 88px 24px; }

  .ouv-others__title { margin-bottom: 36px; }

}

/* ── Tablettes 768–1199 : cartes autres ouvrages centrées + éléments élargis ── */
@media (min-width: 768px) and (max-width: 1199px) {

  .ouv-card__cover-wrap { width: 70%; }

  .ouv-card__body {
    width: 70%;
    text-align: center;
    align-items: center;
    gap: 20px;
  }

  .ouv-card__footer {
    justify-content: center;
  }

}

@media (min-width: 820px) {

  .ouv-fc { --fc-cover-w: 270px; --fc-gap: 26px; }

  .ouv-fc__dark  { min-height: 255px; gap: 20px; }
  .ouv-fc__white { min-height: 85px; }

}

@media (min-width: 992px) {

  .ouv-fc {
    --fc-cover-w : 340px;
    --fc-gap     : 32px;
  }

  .ouv-fc__dark {
    min-height: 270px;
    padding-top: 36px;
    padding-bottom: 40px;
    gap: 22px;
  }

  .ouv-fc__white {
    min-height: 90px;
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
  }

}

/* ── 992px uniquement : prix au-dessus du bouton dans les cartes autres ouvrages ── */
@media (min-width: 992px) and (max-width: 1199px) {

  .ouv-card__footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

}

@media (min-width: 1200px) {

  .ouv-featured { padding: 80px 0 88px; }

  .ouv-fc {
    --fc-cover-w : 380px;
    --fc-gap     : 38px;
    --fc-radius  : 24px;
    /* Carte moins large qu'en pleine largeur */
    max-width: 960px;
    margin-inline: auto;
  }

  .ouv-fc__dark {
    padding-top: 42px;
    padding-bottom: 46px;
    gap: 11px;
    min-height: 300px;
  }

  .ouv-fc__white {
    min-height: 100px;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Grille 3 cols desktop */
  .ouv-grid { grid-template-columns: repeat(3, 1fr); gap: 96px 28px; }

  .ouv-others { padding: 64px 0 96px; }
  .ouv-others__title { margin-bottom: 44px; }

}
