:root {
  --color-primary: #003049;
  --color-secondary: #D62828;
  --color-accent: #F77F00;
  --color-bg: #FDF0D5;
  --color-text: #000000;
  --color-falc-bg: #FFFACD;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
}

header,
footer {
  padding: 2rem;
}

header {
  background-image: url('../../public/images/modeles/livret/hero.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  color: white;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
header::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 48, 73, 0.7);
z-index: 0;
}

header .container {
position: relative;
z-index: 1;
}

header .container h1 {
color: white;
}



#assistant-vocal {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  background-color: var(--color-accent);
  border: none;
  padding: 0.75rem;
  border-radius: 50%;
  font-size: 1.5rem;
  color: #000;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}


#assistant-vocal:hover {
  background-color: var(--color-secondary);
  color: white;
}

#assistant-vocal.actif {
  background-color: var(--color-secondary);
  color: white;
  box-shadow: 0 0 12px 3px var(--color-accent);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 127, 0, 0.6);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 127, 0, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 127, 0, 0);
  }
}



.livret-container {
  max-width: 960px;
  height: 100vh;
  margin: auto;
  padding-bottom: 5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  margin-top: 2rem;
}


 .double-page {
  display: none;
  width: 100%;
  height: 70vh;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: 2rem;
  transform-origin: left center;
  transform: rotateY(90deg);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
  box-sizing: border-box;
  position: absolute;
  top: 0;
}


.double-page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.15) 0%, transparent 80%);
  z-index: 2;
  transform: translateX(-50%);
  pointer-events: none;
}


.double-page.active {
  display: flex;
  opacity: 1;
  transform: rotateY(0);
  z-index: 1;
  position: relative;
}

.page-gauche,
.page-droite {
  width: 48%;
  height: 100%;
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 .5rem 1rem var(--color-primary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
}

.page-gauche p {
  line-height: 1.5;
}

.page-droite .image-container {
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-container button {
  position: absolute;
  top: 0px;
  right: 0px;
  background-color: #F77F00;
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
}
.page-droite img,
.page-droite iframe {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 .2rem .5rem var(--color-primary);
}

.photo-credit {
  font-size: 0.85rem;
  text-align: center;
  color: var(--color-text);
  height: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-buttons {
  text-align: center;
  margin-top: 1rem;
}

.nav-buttons button {
  background-color: var(--color-accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  margin: 0 0.5rem;
  cursor: pointer;
  border-radius: 10px;
}

.nav-buttons button:hover {
  background-color: var(--color-secondary);
}

.pagination-dots {
  text-align: center;
  margin-top: 1rem;
}

.pagination-dots button {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 4px;
  background-color: var(--color-secondary);
  border-radius: 50%;
  opacity: 0.4;
  border: none;
  cursor: pointer;
}

.pagination-dots button.active-dot {
  opacity: 1;
  outline: 2px solid var(--color-accent);
}

.falc-version {
  background-color: var(--color-falc-bg);
  padding: 1rem;
  border-left: 5px solid var(--color-accent);
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.falc-texte-image {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.falc-texte-image p {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
}

.falc-texte-image img {
  width: 100px;
  height: auto;
}

.falc-bouton {
  margin-top: 1rem;
  text-align: center;
  width: 100%;
}

.falc-version button {
  background-color: var(--color-accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 10px;
}

.sommaire {
  text-align: center;
  margin-top: 1rem;
}

.sommaire button {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
  cursor: pointer;
}

.sommaire button:hover {
  background-color: var(--color-secondary);
}

footer {
  background-color: var(--color-primary);
  text-align: center;
  color: white;
}



.demo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.demo-modal-content {
  background: #fff;
  color: #000;
  max-width: 600px;
  width: 90%;
  padding: 2rem;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  max-height: 90vh;
  line-height: 1.5;
}

.demo-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #000;
}

.demo-modal-close:focus {
  outline: 2px solid var(--color-accent);
}

@media (max-width: 768px) {
  .livret-container {
      height: auto;
      padding: 1rem;
      margin-bottom: 5rem;
  }

  .double-page {
      flex-direction: column;
      position: relative;
      transform: none !important;
      opacity: 1 !important;
      height: auto;
  }

  .page-gauche,
  .page-droite {
      width: 100%;
      height: auto;
  }

  .page-droite .image-container {
      height: auto;
      max-height: 300px;
      display: flex;
      justify-content: center;
      align-items: center;
  }

  .page-droite img,
  .page-droite iframe {
      max-height: 100%;
      max-width: 100%;
      height: auto;
      width: auto;
      object-fit: contain;
      border-radius: 10px;
  }

  .photo-credit {
      height: auto;
      margin-top: 0.5rem;
      font-size: 0.85rem;
      text-align: center;
  }

  .nav-buttons {
      display: flex;
      justify-content: center;
      gap: 1rem;
      margin-top: 1rem;
  }

  .nav-buttons button {
      padding: 0.5rem;
      font-size: 1.2rem;
      border-radius: 50%;
      width: 3rem;
      height: 3rem;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: var(--color-accent);
      color: white;
      border: none;
      cursor: pointer;
  }

  .nav-buttons button:hover {
      background-color: var(--color-secondary);
  }

  .pagination-dots {
      margin-top: 1rem;
      text-align: center;
  }

  .pagination-dots button {
      width: 12px;
      height: 12px;
      margin: 0 4px;
      border-radius: 50%;
      border: none;
      background-color: var(--color-secondary);
      opacity: 0.4;
      cursor: pointer;
  }

  .pagination-dots button.active-dot {
      opacity: 1;
      outline: 2px solid var(--color-accent);
  }

  .sommaire {
      text-align: center;
      margin-top: 1rem;
  }

  .sommaire button {
      padding: 0.5rem;
      font-size: 1.2rem;
      border-radius: 50%;
      width: 3rem;
      height: 3rem;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: var(--color-primary);
      color: white;
      border: none;
      cursor: pointer;
  }

  .sommaire button:hover {
      background-color: var(--color-secondary);
  }
}


@media (max-width: 420px) {
   .falc-texte-image {
       flex-direction: column;
   }
   .falc-texte-image img {
       width: 4rem;
       margin-bottom: 1rem;
   }
}


.btn-print {
  font-size: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 5px;
  box-shadow: 0 .2rem .2rem var(--color-accent);
  cursor: pointer;
  position: relative;
}

.btn-print:hover,
.btn-print:focus {
  box-shadow: none;
  transform: translateY(.2rem);
}



@media print {
  body {
    background: white !important;
    color: black !important;
  }

  header,
  footer,
  #assistant-vocal,
  .nav-buttons,
  .pagination-dots,
  .sommaire,
  .btn-print {
    display: none !important;
  }

  .livret-container {
    padding: 0;
    max-width: 100%;
    height: auto;
  }

  .double-page {
    display: flex !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    page-break-inside: avoid;
    margin-bottom: 2rem;
  }

  .page-gauche,
  .page-droite {
    width: 48%;
    height: auto;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .page-droite .image-container img {
    max-height: 300px;
    object-fit: contain;
  }

  .photo-credit {
    font-size: 0.75rem;
    text-align: center;
  }
}



button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.3); /* accent visuel doux */
}