/* ═══════════════════════════════════════════════════════
   FIRMIN JOUBERT — Finitions (novembre 2026)
   D'après les principes d'Emil Kowalski : animations, toucher,
   mobile. Ne change ni les couleurs, ni les polices, ni la mise
   en page : seulement la façon dont le site « réagit ».
   Chargée en DERNIER dans chaque page. Pour l'annuler : retirer
   la ligne <link rel="stylesheet" href="finitions.css">.
   ═══════════════════════════════════════════════════════ */

:root {
  /* Courbes d'animation plus franches que celles du navigateur */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ─────────────────────────────────────────────
   1. TÉLÉPHONE : comportement « appli »
   ───────────────────────────────────────────── */

html {
  -webkit-tap-highlight-color: transparent;   /* plus de flash gris/bleu au toucher */
  -webkit-text-size-adjust: 100%;             /* pas de texte qui grossit en paysage */
}

/* Réaction immédiate au toucher (supprime le délai de 300 ms) */
a, button, [role="button"], summary, label, .btn {
  touch-action: manipulation;
}

/* Un appui long sur un bouton ne sélectionne plus son texte */
.btn, button, .btn-nav-cta, .btn-amazon-card, .btn-feuilleter-card,
.btn-video-card, .btn-detail-card, .btn-acheter, .btn-feuilleter-hero,
.filter-btn, .theme-tag, .nav-burger, .faq-q, .fj-faq__q, .form-submit {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* iPhone : les champs sous 16 px font zoomer la page au toucher */
@media (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; }
}

/* Grands bandeaux « livre » : 100vh déborde sous la barre d'adresse mobile */
.livre-hero { min-height: 100vh; min-height: 100svh; }

/* Menu mobile : le défilement ne passe pas à la page derrière */
.nav-mobile-overlay { overscroll-behavior: contain; }

/* ─────────────────────────────────────────────
   2. ÉCRANS ÉTROITS (320 px) : plus rien ne déborde
   ───────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Encart « Dans le même univers » des pages livres : 1 colonne */
  div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  /* En-têtes de catégorie (page Mes livres) : passent à la ligne */
  .cat-header { flex-wrap: wrap; gap: 8px 12px; }
  .cat-pill { white-space: normal; }
}
/* Un mot très long ne pousse plus la page sur le côté */
h1, h2, h3, .livre-title, .une-card h3, .article-titre { overflow-wrap: break-word; }

/* ─────────────────────────────────────────────
   3. ANIMATIONS : plus courtes, plus nettes
   ───────────────────────────────────────────── */

/* Propriétés précises au lieu de « all » */
.nav-burger span { transition: transform 0.2s var(--ease-out), opacity 0.2s ease; }
.btn-feuilleter-hero { transition: background-color 0.2s ease, border-color 0.2s ease; }
.filter-btn { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }

/* Cartes livres : levée douce, sans rebond ni zoom */
.livre-card { transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out); }
.livre-cover img { transition: transform 0.25s var(--ease-out), filter 0.25s ease; }
.livre-mini-card, .article-card, .lien-rapide {
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}
.livre-cover-img, .livre-featured-cover img, .hero-photo, .une-cover,
.hero-compo-livre, .med-visuel img { transition: transform 0.25s var(--ease-out); }
.theme-tag { transition: transform 0.2s var(--ease-out), filter 0.2s ease, box-shadow 0.2s ease; }

@media (hover: hover) and (pointer: fine) {
  .livre-card:hover { transform: translateY(-5px); }
  .livre-card:hover .livre-cover img { transform: translateX(-6px); }
  .theme-tag:hover { transform: translateY(-2px); filter: brightness(1.15); }
}

/* Bouton « retour en haut » */
#btn-top { transition: opacity 0.2s ease, transform 0.2s var(--ease-out); }
#btn-top.show:active { transform: scale(0.94); transition-duration: 0.1s; }

/* FAQ : ouverture plus nette (la hauteur exacte est calculée par nav.js) */
.faq-a { transition: max-height 0.28s var(--ease-out); }
.faq-q .faq-icon { transition: transform 0.2s var(--ease-out), background-color 0.2s ease; }
.fj-faq__q::after { transition: transform 0.2s var(--ease-out); }

/* Menu mobile : fondu à l'ouverture au lieu d'une apparition brutale */
.nav-mobile-overlay {
  display: flex;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.22s var(--ease-out), visibility 0s linear 0.22s;
}
.nav-mobile-overlay.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.22s var(--ease-out), visibility 0s;
}

/* Barre de lecture : animée par transform (plus fluide que width) */
#reading-progress-bar {
  width: 100% !important;
  transform: scaleX(0); transform-origin: 0 50%;
  transition: none; border-radius: 0;
}

/* Apparition au chargement : départ vers le haut, sans traîner */
.fade-up { animation-duration: 0.5s; animation-timing-function: var(--ease-out); }

/* ─────────────────────────────────────────────
   4. ÉCRANS TACTILES : les survols ne restent plus « collés »
   (sur téléphone, le premier toucher déclenche :hover et le laisse)
   ───────────────────────────────────────────── */
@media (hover: none) {
  .livre-card:hover,
  .livre-card:hover .livre-cover img,
  .livre-mini-card:hover, .article-card:hover, .lien-rapide:hover,
  .theme-tag:hover, .une-cover:hover, .hero-photo:hover,
  .livre-cover-img:hover, .livre-featured-cover:hover img,
  .med-visuel:hover img, .theme-toggle-btn:hover,
  .btn-acheter:hover, #exit-submit:hover, .form-submit:hover,
  a[onmouseover] { transform: none !important; }
  .hero-compo-livre--1:hover { transform: rotate(-6deg) !important; }
  .hero-compo-livre--2:hover { transform: rotate(3deg) !important; }
  .theme-tag:hover { filter: none; box-shadow: none; }
  .theme-tag:hover::after { opacity: 0; }
}

/* ─────────────────────────────────────────────
   5. RETOUR AU TOUCHER pour les boutons sans relief
   ───────────────────────────────────────────── */
.btn-acheter, .btn-feuilleter-hero, .filter-btn, .lien-rapide, .theme-tag,
.theme-toggle-btn, .biblio-themes a {
  transition-property: transform, background-color, border-color, color, box-shadow, filter;
  transition-duration: 0.16s;
  transition-timing-function: var(--ease-out);
}
.btn-acheter:active, .btn-feuilleter-hero:active, .filter-btn:active,
.lien-rapide:active, .theme-tag:active, .theme-toggle-btn:active,
.biblio-themes a:active { transform: scale(0.97) !important; }

/* ─────────────────────────────────────────────
   6. MOUVEMENT RÉDUIT (réglage d'accessibilité du visiteur)
   On garde les fondus, on retire les déplacements.
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .livre-card:hover, .livre-card:hover .livre-cover img, .livre-mini-card:hover,
  .article-card:hover, .lien-rapide:hover, .theme-tag:hover, .une-cover:hover,
  .hero-photo:hover, .livre-cover-img:hover, .livre-featured-cover:hover img,
  .med-visuel:hover img, .btn:hover, .btn-amazon-card:hover,
  .btn-feuilleter-card:hover, .btn-video-card:hover, .btn-detail-card:hover,
  .btn-nav-cta:hover, #exit-modal, #med-modal { transform: none !important; }
  .fade-up { animation: none; opacity: 1; }
}

/* ─────────────────────────────────────────────
   7. PAGES LIVRES : bloc « En bref »
   (remplace « Voir dans mon salon », nov. 2026)
   ───────────────────────────────────────────── */
.en-bref { background: #07090f; padding: 40px 20px 48px; position: relative; z-index: 1; color: #fff; }
.en-bref__in { max-width: 980px; margin: 0 auto; }
.en-bref__tag {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
}
.en-bref__tag::before, .en-bref__tag::after { content: ""; width: 28px; height: 1.5px; background: currentColor; opacity: .55; }
.en-bref__grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.en-bref__carte {
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px; padding: 22px 20px;
  color: rgba(255,255,255,0.72); text-decoration: none;
}
.en-bref__ic {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent); font-size: 1.15rem; margin-bottom: 4px;
}
.en-bref__carte h2 {
  font-family: var(--font-titre); font-size: 1.28rem; font-weight: 700;
  line-height: 1.15; color: #fff; margin: 0;
}
.en-bref__carte p { font-size: 0.9rem; line-height: 1.6; margin: 0; }
.en-bref__carte--lien {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease, border-color 0.2s ease;
}
.en-bref__fleche { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 0.88rem; color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .en-bref__carte--lien:hover { transform: translateY(-3px); background: color-mix(in srgb, var(--accent) 18%, transparent); }
}
.en-bref__carte--lien:active { transform: scale(0.97); }
.en-bref__carte--lien:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#lire-le-debut { scroll-margin-top: calc(var(--nav-h, 70px) + 16px); }
@media (max-width: 760px) {
  .en-bref { padding: 32px 20px 40px; }
  .en-bref__grille { grid-template-columns: 1fr; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .en-bref__carte--lien:hover { transform: none; }
}
