/* VARIABLES : personnalisez ici */
:root {
  --page-bg: #ffffff;
  --accent: #b9863e; /* changez ici la couleur principale */
  --text: #ffb87d;
  --muted: #6b6b6b;
  --transition: 800ms;
  --card-w: 565.6px;
  --card-h: 800px;
}

/* RESET DE BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Poppins", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SCÈNE (3D container) */
.scene {
  perspective: 2200px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* CARTE */
.card {
  width: var(--card-w);
  height: var(--card-h);
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--transition) cubic-bezier(.2,.9,.3,1);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  cursor: pointer;
}

.card.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

/* RECTO */
.card-front {
  background: #fff;
}
.fp-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* VERSO */
.card-back {
  transform: rotateY(180deg);
  background: url("../images/back.png") center/cover no-repeat;
  display: flex;
  flex-direction: column;
}

/* HEADER MENU */
.back-header {
  display: flex;
  align-items: center;
  justify-content: center; /* <-- centre horizontalement le menu */
  padding: 20px 30px;
  background: rgba(255,255,255,0); /* Optionnel : totalement transparent pour être sur le background */
}
}
.brand-text {
  font-family: "Caprasimo", cursive;
  font-size: 24px;
  color: var(--accent);
}
.back-nav a {
  margin: 0 12px; /* <-- espace entre les liens */
  text-decoration: none;
  color: white; /* blanc sur le fond */
  font-weight: 600;
  transition: color 0.3s;
}
/* Menu header — lien actif */
.back-nav a.active {
  color: var(--text); /* <-- couleur principale */
  text-decoration: underline; /* souligné */
}
.back-nav a:hover {
  color: var(--text);
}

/* MAIN CONTENT */
.back-main {
  position: relative;        /* permet aux enfants en absolute d’être positionnés */
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;   /* centre horizontalement */
  overflow: hidden;
}

.page-content {
  position: absolute;
  top: 50%;       /* position verticale centrée par défaut */
  left: 0;        /* commence à gauche */
  right: 0;       /* prend toute la largeur */
  margin: 0 auto; /* centre horizontalement mais sans limiter la largeur */
  text-align: center; /* optionnel, texte centré */
  transform: translateY(-50%); /* ne déplace que verticalement */
}

/* Pages scrollables avec centrage ajustable */
.page-content-scrollable {
  position: absolute;       /* absolute pour pouvoir jouer avec top */
  top: 50%;                 /* centrage vertical par défaut */
  left: 0;
  right: 0;
  height: 100%;
  overflow-y: auto;         /* scroll si le contenu dépasse */
  padding: 20px 40px;
  text-align: center;
  transform: translateY(-50%); /* garde centrage vertical */
}

.scrollable {
  overflow-y: auto;
  max-height: calc(var(--card-h) - 200px);
  padding-right: 8px;
}
.back-title {
  font-family: "Caprasimo", cursive;
  font-size: 42px;
  color: var(--accent);
  margin: 20px 0 8px;
}
.back-sub {
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 16px;
}

/* FOOTER / BOUTON RETOUR */
.back-footer {
  padding: 20px;
  text-align: center;
}
.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

/* --- Vue mobile : centrage parfait + taille fluide sans rognage --- */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* on bloque les débordements */
    background: var(--page-bg);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .scene {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    perspective: 1500px;
  }

  .card {
    width: min(90vw, 565.6px); /* ne dépasse jamais sa taille max */
    height: calc(min(90vw, 565.6px) * (2000 / 1414));
    max-height: 95vh;
    transform: none;
    margin: 0 auto;
  }

  /* Texte adaptatif fluide */
  body {
    font-size: clamp(12px, 2vw, 16px);
  }

  .back-title {
    font-size: clamp(24px, 5vw, 36px);
  }

  .back-sub {
    font-size: clamp(14px, 3vw, 18px);
  }

  .back-nav a {
    font-size: clamp(12px, 2.8vw, 16px);
  }

  /* Correction : empêche tout rognage horizontal */
  img.fp-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* garde le ratio complet */
  }
}

/* Ultra petits écrans */
@media (max-width: 480px) {
  .card {
    width: min(95vw, 565.6px);
    height: calc(min(95vw, 565.6px) * (2000 / 1414));
  }

  body {
    font-size: clamp(11px, 3vw, 14px);
  }
}
