/* ----- Reset rapide ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #14273c 0, #05060a 55%);
  color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ----- Header / Logo / Nav ----- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #05060a;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.5rem 1.5rem; /* réduit un peu pour gagner de la place */
}
.logo {
  display: flex;
  flex-direction: column;
  letter-spacing: 0.12em;
}

.logo-main {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
}

.logo-sub {
  font-size: 0.85rem;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Logo image */
.logo img{
  height: 125px;
  width: auto;
  display: block;
}
@media (max-width: 640px){
  :root{ --header-h: 120px; } /* header plus petit sur mobile */

  .logo img{
    height: 96px; /* recommandé */
  }

  #flipbook-page{
    max-height: calc(100vh - var(--header-h) - 170px);
  }
}

/* Barre de navigation */

.main-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.nav-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #f5f5f5;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-btn.active {
  background: #f5b318;
  color: #05060a;
  border-color: #f5b318;
}

/* ----- Contenu principal ----- */

.site-main {
  width: 100%;
  max-width: 1100px;
  margin: 1.5rem auto 2rem;
  padding: 0 1.5rem;
  flex: 1;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.intro {
  margin-bottom: 1.5rem;
  opacity: 0.85;
}

/* Animation simple */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- Galerie de planches BD ----- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.gallery-item img {
  width: 100%;
  display: block;
}

.gallery-item figcaption {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ----- Cartes personnages ----- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.card {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: top center; /* 👈 ancrage en haut */
  display: block;
}
.card-body {
  padding: 0.9rem 1rem 1rem;
}

.card-body h2 {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.card-body .role {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #f5b318;
  margin-bottom: 0.5rem;
}

.card-body .desc {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ----- Formulaire de contact ----- */

.contact-form,
.legal-box {
  max-width: 640px;   /* même largeur que le footer visuellement */
  margin-left: auto;
  margin-right: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.9rem;
}

.form-status {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  opacity: 0.8;
  min-height: 1em;
}


label {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

input,
textarea {
  background: rgba(4, 6, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.4rem;
  padding: 0.45rem 0.6rem;
  color: #f5f5f5;
  font-size: 0.95rem;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #f5b318;
}

.btn-submit {
  margin-top: 0.3rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #f5b318;
  color: #05060a;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.1s;
}

.btn-submit:hover {
  background: #ffca46;
  transform: translateY(-1px);
}

/* ----- Footer ----- */

.site-footer {
  text-align: center;
  padding: 1.2rem 1.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
  max-width: 640px;
  margin: 2rem auto 1rem;
  background: none;
  border: none;
}

/* ----- Responsive petites largeurs ----- */

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: center;
  }
 .main-nav {
    margin-top: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  .site-main {
    padding: 0 1rem;
  }
}

/* ----- Flipbook BD ----- */

.flipbook {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.flipbook-page-wrapper {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: #000;
  border-radius: 0.6rem;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

#flipbook-page{ max-height: calc(100vh - var(--header-h) - 110px); }

/* Effet page qui se tourne */
.flipbook-page-wrapper {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: #000;
  border-radius: 0.6rem;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  perspective: 1400px; /* donne un effet 3D */
}

#flipbook-page {
  width: 100%;
  display: block;
  transform-origin: left center;
}

/* Animation quand on va vers la page suivante */
.flip-anim-next {
  animation: pageTurnNext 0.6s ease forwards;
}

/* Animation quand on va vers la page précédente */
.flip-anim-prev {
  animation: pageTurnPrev 0.6s ease forwards;
}

@keyframes pageTurnNext {
  0% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
  45% {
    transform: rotateY(-85deg) scale(0.98);
    opacity: 0.15;
  }
  50% {
    transform: rotateY(85deg) scale(0.98);
    opacity: 0.15;
  }
  100% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes pageTurnPrev {
  0% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
  45% {
    transform: rotateY(85deg) scale(0.98);
    opacity: 0.15;
  }
  50% {
    transform: rotateY(-85deg) scale(0.98);
    opacity: 0.15;
  }
  100% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
}

/* Barre d’infos sous la planche */
.flipbook-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.3rem 0.7rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

/* Boutons précédent / suivant */
.flip-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(10, 12, 24, 0.85);
  color: #f5f5f5;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
}

.flip-btn:hover {
  background: #f5b318;
  border-color: #f5b318;
  color: #05060a;
  transform: translateY(-1px);
}

/* Miniatures */
.flipbook-thumbs {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.flipbook-thumbs .thumb {
  width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 0.3rem;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.15s, border-color 0.15s, transform 0.1s;
}

.flipbook-thumbs .thumb:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.flipbook-thumbs .thumb.active {
  opacity: 1;
  border-color: #f5b318;
}

/* Responsive : sur mobile, on met les boutons au-dessus/dessous */
@media (max-width: 640px) {
  .flipbook {
    flex-direction: column;
  }
      
}
/* ----- Mentions légales ----- */

.legal-box {
  max-width: 820px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.8rem;
  padding: 1.2rem 1.4rem;
  line-height: 1.55;
}

.legal-box p {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  opacity: 0.95;
}

.legal-box hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 1rem 0;
}

.legal-note {
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.85;
}

/* Lien footer */
.site-footer .legal-link a {
  color: #f5b318;
  text-decoration: none;
  font-size: 0.8rem;
}

.site-footer .legal-link a:hover {
  text-decoration: underline;
}

/* =========================================================
   RESPONSIVE – PAGE BD / FLIPBOOK
   ========================================================= */

/* Taille écran standard (desktop) */
#bd .flipbook-page-wrapper{
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Wrapper principal */
.flipbook-page-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Image toujours contenue dans l’écran */
#flipbook-page{
  width: 100%;
  max-height: calc(100vh - var(--header-h) - 140px); 
  /* 140px ≈ titre + intro + boutons + marges + miniatures */
  object-fit: contain;
  display: block;
}

/* =========================================================
   TABLETTE
   ========================================================= */
@media (max-width: 1024px) {
  #flipbook-page {
    max-height: 70vh;
  }

  .flipbook {
    gap: 0.6rem;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 640px) {
  /* Titre BD plus compact */
  #bd h1 {
    font-size: 1.4rem;
    text-align: center;
  }

  #bd .intro {
    font-size: 0.9rem;
    text-align: center;
  }

  /* Flipbook en colonne */
  .flipbook {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Boutons plus larges (pouce friendly) */
  .flip-btn {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  /* Planche */
  #flipbook-page {
    max-height: 65vh;
  }

  /* Infos planche */
  .flipbook-meta {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  /* Miniatures → scroll horizontal */
  .flipbook-thumbs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    gap: 0.35rem;
  }

  .flipbook-thumbs::-webkit-scrollbar {
    height: 6px;
  }

  .flipbook-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
  }

  .flipbook-thumbs .thumb {
    flex: 0 0 auto;
    width: 60px;
    height: 85px;
  }
}

/* =========================================================
   TRÈS PETITS ÉCRANS (smartphones anciens)
   ========================================================= */
@media (max-width: 360px) {
  #flipbook-page {
    max-height: 58vh;
  }

  .flip-btn {
    width: 40px;
    height: 40px;
  }
}
:root{
  --header-h: 170px;   /* ajuste si besoin (logo 150px + paddings) */
  --bd-gap: 24px;      /* marge/padding global */
}

/* Protection basique des images */
img {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
}


/* Indication visuelle : clic sur la planche */
#flipbook-page {
  cursor: pointer;
}

#flipbook-page:active {
  filter: brightness(0.95);
}

/* Bouton fullscreen un peu distinct */
.flip-btn.fs {
  border-color: rgba(245, 179, 24, 0.6);
}

/* Quand on est en mode lecture (fallback CSS) */
body.reading-mode .site-header,
body.reading-mode .site-footer,
body.reading-mode #personnages,
body.reading-mode #contact,
body.reading-mode #legal,
body.reading-mode #bd h1,
body.reading-mode #bd .intro,
body.reading-mode .flipbook-thumbs {
  display: none !important;
}

body.reading-mode .site-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.reading-mode #bd {
  display: block;
  padding: 0;
  margin: 0;
}

body.reading-mode .flipbook {
  margin: 0;
  padding: 0.6rem;
  gap: 0.6rem;
}

body.reading-mode .flipbook-page-wrapper {
  max-width: 100vw;
  width: 100%;
  border-radius: 0.4rem;
}

body.reading-mode #flipbook-page {
  max-height: 92vh; /* presque toute la hauteur */
  object-fit: contain;
}

.flipbook-page-wrapper {
  position: relative; /* OBLIGATOIRE */
}

/* Flèches gauche / droite */
.flipbook-page-wrapper .flip-btn.prev,
.flipbook-page-wrapper .flip-btn.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  opacity: 0.85;
}

.flipbook-page-wrapper .flip-btn.prev {
  left: 8px;
}

.flipbook-page-wrapper .flip-btn.next {
  right: 8px;
}


.flipbook-page-wrapper .flip-btn.prev,
.flipbook-page-wrapper .flip-btn.next {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

/* Apparition au survol du bloc planche (desktop) */
.flipbook-page-wrapper:hover .flip-btn.prev,
.flipbook-page-wrapper:hover .flip-btn.next {
  opacity: 0.9;
  pointer-events: auto;
}

/* Mobile : classe temporaire pour montrer les flèches */
.flipbook-page-wrapper.show-arrows .flip-btn.prev,
.flipbook-page-wrapper.show-arrows .flip-btn.next {
  opacity: 0.9 !important;
  pointer-events: auto !important;
}


.notfound-actions{
  display:flex;
  gap:0.8rem;
  justify-content:center;
  flex-wrap:wrap;
  margin: 1rem 0 0.6rem;
}

.btn-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  text-decoration:none;
  color: inherit;
  opacity: 0.9;
}
.btn-secondary:hover{
  border-color: rgba(245,179,24,0.8);
}
.notfound-small{
  text-align:center;
  font-size:0.9rem;
  opacity:0.75;
  margin-top: 0.6rem;
}


/* ----- Hiérarchie titres (SEO + lisibilité) ----- */
h1 { font-size: 2rem; margin-bottom: 0.8rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.6rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }

.center{
  text-align:center;
}


/* ----- Flèches du flipbook : visibles au survol (desktop) / au tap (mobile) ----- */
.flipbook-page-wrapper .flip-btn.prev,
.flipbook-page-wrapper .flip-btn.next{
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.flipbook-page-wrapper:hover .flip-btn.prev,
.flipbook-page-wrapper:hover .flip-btn.next{
  opacity: 0.9;
  pointer-events: auto;
}

.flipbook-page-wrapper.show-arrows .flip-btn.prev,
.flipbook-page-wrapper.show-arrows .flip-btn.next{
  opacity: 0.9 !important;
  pointer-events: auto !important;
}

/* Mobile/tablette : pas de hover, on ne montre que via .show-arrows */
@media (hover: none){
  .flipbook-page-wrapper:hover .flip-btn.prev,
  .flipbook-page-wrapper:hover .flip-btn.next{
    opacity: 0;
    pointer-events: none;
  }
}

/* ===== LANGUAGE SWITCH ===== */
.site-header{
  position: relative;
}

.lang-switch{
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
}

.lang-switch a{
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.lang-switch a.active{
  font-weight: 700;
}

.lang-switch span{
  margin: 0 6px;
  opacity: 0.6;
}
