/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

body {
  background-color: white;
  color: black;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Jost', sans-serif;
  font-size: 16px; /* Base font size */
  line-height: 1.6; /* Improved readability */
}

.container {
  width: 80%; /* Default for portrait on mobile */
  max-width: 1200px; /* Maximum width on large screens */
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
}

/* Style pour la div langage */
.langage {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.langage a {
  text-decoration: none;
  color: black;
  margin: 10px;
  padding: 5px 10px; /* Larger touch target */
  position: relative; /* For accessibility focus indicator */
  font-size: 1.1em; /* Slightly larger for better readability */
}

.langage a:hover {
  color: rgb(255, 187, 0);
}

.langage a:focus {
  outline: 2px solid rgb(255, 187, 0); /* Visible focus for keyboard navigation */
  outline-offset: 3px;
}

.langage a.current {
  color: rgb(255, 187, 0);
  /* font-weight: bold; /* Better visual indication of current page */
}

.logo-section {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logo-section img {
  width: 33%;
  max-width: 200px; /* Limit size on large screens */
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.5s ease;
}

.logo-section img:hover {
  transform: scale(1.1);
}

.content-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
}

.content-section h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5em; /* More responsive size */
  line-height: 1.2;
  word-wrap: break-word; /* Prevent overflow on small screens */
}

.content-section h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.8em;
  position: relative;
  display: inline-block;
}

.content-section h2::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: rgb(255, 187, 0);
  transition: width 0.5s ease;
}

.content-section h2:hover::after,
.content-section h2:focus::after {
  width: 100%;
}

.content-section p {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1em;
}

/* Modification de la section navigation pour aligner les CTA */
.navigation-section {
  display: flex;
  justify-content: space-between; /* Espace les éléments (premier à gauche, second à droite) */
  align-items: center;
  margin-top: 30px;
  width: 100%; /* Assure que la section prend toute la largeur disponible */
}

/* Animation d'apparition au défilement */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animation des boutons CTA */
.cta {
  padding: 12px 24px; /* Larger touch target */
  background-color: #f0f0f0;
  text-decoration: none;
  color: black;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-block;
  text-align: center;
  margin: 5px;
  font-weight: 500;
  min-width: 120px; /* Minimum width for better touch targets */
  transform: translateY(0); /* Position initiale fixe */
  box-shadow: 0 0 0 rgba(0,0,0,0); /* Ombre initiale invisible */
}

.cta:hover {
  background-color: #e0e0e0;
  color: white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  /* Suppression du transform: translateY(-3px) qui causait le décalage */
}

.cta:focus {
  outline: 2px solid rgb(255, 187, 0);
  outline-offset: 3px;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: rgb(255, 187, 0);
  transition: all 0.3s ease;
  z-index: -1;
}

.cta:hover::before {
  left: 0;
}

/* Nouvel effet de flash et d'augmentation de taille au survol */
.cta::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  transform: scale(0.5);
  z-index: 1;
  pointer-events: none; /* Pour ne pas interférer avec les événements de survol */
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.cta:hover::after {
  animation: flash-pulse 0.8s ease-out;
  opacity: 1;
  transform: scale(1.5);
}

@keyframes flash-pulse {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Réduction des animations si préféré */
@media (prefers-reduced-motion: reduce) {
  .cta::after {
    animation: none;
    transition: none;
  }
  
  .cta:hover::after {
    animation: none;
    opacity: 0.5;
    transform: none;
  }
}

/* Indicateur de défilement */
.scroll-indicator {
  position: absolute;
  z-index: 100;
  text-align: center;
  opacity: 1;
  transition: opacity 0.2s ease;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-down-icon {
  color: rgb(255, 187, 0);
  font-size: 36px;
  animation: bounce 2s infinite;
}

.scroll-text {
  display: block;
  margin-top: 10px;
  font-size: 0.9em;
  color: #666;
  font-weight: 500;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Barre de progression de lecture */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background-color: rgb(255, 187, 0);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Amélioration pour les utilisateurs qui préfèrent réduire les animations */
@media (prefers-reduced-motion: reduce) {
  .scroll-down-icon {
    animation: none;
  }
  
  .reading-progress-bar {
    transition: none;
  }
}

/* Animation des paragraphes numérotés */
.content-section p strong {
  display: inline-block;
  background-color: #f0f0f0;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.content-section p:hover strong {
  background-color: rgb(255, 187, 0);
  color: white;
  transform: rotate(360deg);
}

/* Assurez-vous que le dernier paragraphe est visible */
.content-section p:last-child {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Reduce animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .logo-section img,
  .content-section h2::after,
  .cta,
  .cta::before,
  .content-section p strong {
    transition: none;
    animation: none;
    transform: none;
  }
  
  .fade-in {
    opacity: 1;
  }
  
  .logo-section img:hover,
  .content-section p:hover strong {
    transform: none;
  }
}

/* Media Queries for Responsive Design */

/* Landscape orientation (all devices) */
@media (orientation: landscape) {
  .container {
    width: 60%;
  }
}

/* Small devices (phones, 576px and down) */
@media only screen and (max-width: 576px) {
  body {
    font-size: 14px;
  }
  
  .container {
    width: 90%;
    padding: 10px;
  }
  
  .content-section h1 {
    font-size: 2em;
    margin-bottom: 20px;
  }
  
  .content-section h2 {
    font-size: 1.5em;
  }
  
  .logo-section img {
    width: 50%;
  }
  
  .navigation-section {
    flex-direction: column;
    align-items: center;
  }
  
  .cta {
    width: 30%;
    margin: 5px 0;
  }
}

/* Medium devices (tablets, 577px to 768px) */
@media only screen and (min-width: 577px) and (max-width: 768px) {
  .container {
    width: 85%;
  }
  
  .content-section h1 {
    font-size: 2.2em;
  }
  
  .logo-section img {
    width: 40%;
  }
}

/* Large devices (tablets landscape, small laptops, 769px to 992px) */
@media only screen and (min-width: 769px) and (max-width: 992px) {
  .container {
    width: 60%;
  }
  
  .content-section h1 {
    font-size: 2.3em;
  }
}

/* Extra large devices (large laptops and desktops, 993px to 1200px) */
@media only screen and (min-width: 993px) and (max-width: 1200px) {
  .container {
    width: 45%;
  }
}

/* Super large devices (large desktops, 1201px and up) */
@media only screen and (min-width: 1201px) {
  body {
    font-size: 18px;
  }
  
  .container {
    width: 45%;
  }
}

/* Specific adjustments for portrait tablets */
@media only screen and (min-width: 768px) and (max-width: 992px) and (orientation: portrait) {
  .container {
    width: 80%;
  }
}

/* Specific adjustments for landscape phones */
@media only screen and (max-width: 767px) and (orientation: landscape) {
  .container {
    width: 70%;
    padding: 15px;
  }
  
  .content-section h1 {
    margin-bottom: 15px;
  }
  
  body {
    align-items: flex-start;
    padding-top: 20px;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

