/* ============================================================
   PIF GADGET - page « Qui est Pif ? » (pastille Planète Pif)
   Portrait, personnages, frise historique, points de vente.
   Commun : site.css.
   ============================================================ */

/* ---------- Portrait : visuel + texte ---------- */

.portrait {
  display: grid;
  grid-template-columns: minmax(240px, 400px) 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.portrait__visuel {
  position: sticky;
  top: 24px;
  margin: 0;
  padding: 12px 12px 16px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 10px;
  box-shadow: 0 3px 0 rgba(0,19,38,.10), 0 26px 44px -18px rgba(0,19,38,.5);
  rotate: -2deg;
}

.portrait__visuel img { width: 100%; height: auto; aspect-ratio: 497 / 422; border-radius: 6px; display: block; }

.portrait__visuel figcaption {
  margin-top: 10px;
  font-family: var(--titre);
  font-size: .82rem;
  color: var(--encre-60);
  text-align: center;
}

.portrait__texte h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 600; }
.portrait__texte h2:not(:first-child) { margin-top: clamp(28px, 4vw, 44px); }
.portrait__texte p { margin: 14px 0 0; max-width: 64ch; color: var(--encre-60); }
.portrait__texte p.chapo { font-size: 1.08rem; color: var(--encre); font-weight: 600; }

.portrait__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.portrait__actions .btn { padding: 11px 20px; font-size: .74rem; }

/* ---------- Personnages ---------- */

.persos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}

.perso {
  position: relative;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
  transition: transform .14s ease, rotate .14s ease;
}

.perso:hover { transform: translateY(-4px); rotate: -1.2deg; }
.perso:nth-child(even):hover { rotate: 1.2deg; }

.perso__media { aspect-ratio: 4 / 5; background: var(--blanc); }
.perso__media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.perso__media--contient img { object-fit: contain; padding: 10px 10px 0; }

.perso__nom {
  display: block;
  margin: -16px 10px 12px;
  position: relative;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--encre);
  background: var(--jaune);
  color: var(--encre);
  font-family: var(--titre);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  /* les noms longs (Professeur Bellepomme) passent sur deux lignes */
  text-wrap: balance;
}

/* ---------- Frise historique ---------- */

.frise {
  position: relative;
  /* d'un bord à l'autre de l'écran, première carte alignée sur le contenu */
  margin-inline: calc(50% - 50vw);
  padding-inline: max(calc(var(--gouttiere) + 12px), calc(50vw - 50% + 12px)) max(var(--gouttiere), calc(50vw - 50%));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.frise::-webkit-scrollbar { display: none; }

.frise__piste {
  list-style: none;
  margin: 0;
  /* 50 px en haut : la place des pastilles d'année */
  padding: 50px 0 30px;
  display: flex;
  gap: 20px;
  width: max-content;
  position: relative;
}

/* La ligne du temps vit hors de la piste défilante, sur toute la
   largeur de la page. */
.frise-zone { position: relative; }

.frise-zone::before {
  content: "";
  position: absolute;
  top: 25px;
  left: calc(50% - 50vw);
  width: 100vw;
  border-top: 3px dashed var(--encre-35);
  pointer-events: none;
}

#histoire { overflow-x: clip; }

.frise-zone .fleches { top: -66px; right: 0; }

.epoque {
  flex: 0 0 250px;
  position: relative;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 22px 18px 20px;
}

.epoque__annee {
  position: absolute;
  top: -42px;
  left: 16px;
  font-family: var(--titre);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .04em;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--encre);
  color: var(--blanc);
}

.epoque--cle .epoque__annee { background: var(--rouge); }

.epoque p { margin: 0; font-size: .95rem; color: var(--encre); }

/* ---------- Où trouver le magazine ---------- */

.points {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(180px, 300px);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 26px;
  padding: clamp(24px, 3.4vw, 46px) clamp(22px, 3.4vw, 46px) 0;
  box-shadow: var(--ombre);
  overflow: hidden;
}

.points__texte { padding-bottom: clamp(24px, 3.4vw, 46px); }
.points h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 600; }
.points p { margin: 14px 0 0; max-width: 62ch; color: var(--encre-60); }
.points p.chapo { font-size: 1.08rem; color: var(--encre); font-weight: 600; }

.points__conseil {
  margin-top: 18px !important;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px dashed var(--encre-35);
  background: var(--cahier);
  color: var(--encre) !important;
  font-size: .95rem;
}

.points__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 24px; }
.points__salut { font-family: var(--titre); font-weight: 600; color: var(--rouge); }

.points__pif { align-self: end; }
.points__pif img { display: block; width: 100%; }

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .portrait { grid-template-columns: 1fr; }
  .portrait__visuel { position: static; width: min(78%, 320px); margin-inline: auto; }
  .portrait__actions .btn { flex: 1; text-align: center; }

  /* personnages : une rangée qui défile au doigt */
  .persos {
    display: flex;
    gap: 14px;
    margin-inline: calc(var(--gouttiere) * -1);
    padding: 6px var(--gouttiere) 22px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gouttiere);
    scrollbar-width: none;
  }
  .persos::-webkit-scrollbar { display: none; }
  /* défilement automatique (frise.js) : l'aimantation des cartes le bloquerait */
  .persos[data-frise-piste] { scroll-snap-type: none; }
  .perso { flex: 0 0 44vw; max-width: 210px; scroll-snap-align: start; }

  .section__tete { align-items: start; }
  .frise-zone .fleches { position: static; transform: none; justify-content: flex-end; margin-bottom: 8px; pointer-events: auto; }
  .frise-zone .fleche { background: var(--blanc); }
  .frise-zone::before { top: calc(25px + 54px); }

  .points { grid-template-columns: 1fr; }
  .points__pif { width: min(60%, 220px); margin-inline: auto; }
  .points__texte { padding-bottom: 8px; }
  .points__actions .btn { flex: 1; text-align: center; }
}

@media (max-width: 560px) {
  .epoque { flex-basis: 220px; }
}

/* Page sans image mise en avant : le texte seul, centré */
.portrait--sans-visuel { grid-template-columns: minmax(0, 880px); justify-content: center; }
