/* ==========================================================================
   pageAccueil_responsive.css
   Mobile-first responsive stylesheet layered on top of the original styles.
   You can include it AFTER pageAccueil.css to override only where needed.
   ========================================================================== */

/* 1) Global resets & helpers */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --radius: 12px;
  --max-content: 1200px;
  --shadow-soft: 0 6px 20px rgba(0,0,0,.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===========================
   NOEL / VIDEO HOVER
   =========================== */

.noel-container{
  position: fixed;
  top: 20px;
  left: 20px;
  width: 100px;
  height: 100px;

  /* FIX: autoriser l’élément enfant à sortir du 50x50 */
  overflow: visible;

  /* FIX: s’assurer que ça passe au-dessus du reste */
  z-index: 9999;
}

/* Les 2 éléments restent DANS le container */
.noel-container .lettre,
.noel-container .danse{
  position: absolute;
  top: 0;
  left: 0;
}

/* LETTRE : zoom visible puis disparition */
.noel-container .lettre{
  width: 50px;
  transform-origin: center;
  transition:
    transform 0.55s cubic-bezier(.4,0,.2,1),
    opacity   0.25s ease 0.25s;
}
.noel-container:hover .lettre{
  transform: scale(2.2);
  opacity: 0;
}

/* Ouverture pilotée par JS (1ère visite + clic / mobile) */
.noel-container.noel-open .lettre{
  transform: scale(2.2);
  opacity: 0;
}

/* VIDEO/GIF : caché au départ */
.noel-container .danse{
  opacity: 0;

  /* tant que caché, on évite tout clic */
  pointer-events: none;

  width: 50px;
  aspect-ratio: 16 / 9;

  /* IMPORTANT: on garde au départ, mais on le neutralise au hover/open */
  max-width: 50px;

  transition:
    opacity .25s ease .35s,
    width .75s cubic-bezier(.2,.8,.2,1) .35s;
}

.noel-container.noel-open .actu {
  opacity: 0;
  pointer-events: none;
}

/* Bandeau d'actu : possibilité de pause via JS */
.actu.is-paused{
  animation-play-state: paused;
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   FIX MAJEUR : "maximisation" réelle au hover / open
   - neutralise max-width
   - passe en fixed et centre la vidéo
   - limite la hauteur à 90vh
   ========================================================= */

.noel-container:hover .danse,
.noel-container.noel-open .danse{
  opacity: 1;

  /* FIX: autoriser le clic/contrôles vidéo si besoin */
  pointer-events: auto;

  /* FIX: enlever la limitation 50px */
  max-width: none;

  /* FIX: vraie mise en avant */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  /* taille */
  width: min(90vw, 1820px);
  height: auto;
  max-height: 90vh;

  /* au-dessus de tout */
  z-index: 10000;
}

/* 2) Page */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  /*background-image: url(../../assets/images/serpe/Fond-bg-noel-intranet-2025.jpg);*/
  background-image: url(../../assets/images/serpe/fondAccueil.jpg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Optional container to limit max width */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* 3) Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-5);
  flex-wrap: wrap;
}

.left,
.right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search_logo {
  height: 72px; /* fluid-ish; overridden on larger screens */
  padding: 0 var(--space-5);
}

/* Search form: remove absolute positioning, make it flow & shrink on small screens */
.search_form {
  display: flex;
  align-items: center;
  height: 48px;
  position: static;         /* override right: -600px */
  right: auto;
  flex: 1 1 280px;
  max-width: 520px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  background: #f1f1f1;
  padding-right: 2px; /* room for button overlap */
}

.search_form:focus-within {
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  background-color: #f7f7f7;
}

.recherche {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 24px 0 0 24px;
  background-color: transparent;
  font-size: 1rem;
}

.recherche:focus-visible {
  outline: none;
}

.button {
  border: none;
  padding: 0;
  border-radius: 0 24px 24px 0;
  cursor: pointer;
  background: transparent;
}

.imgButton {
  background: transparent;
  width: 48px;
  height: 48px;
  border-radius: 0 24px 24px 0;
  padding: 6px;
}

/* 4) Main content */
.regroupement_dossier {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;    /* allow wrapping for smaller screens */
  gap: 20px;
  margin: 0 var(--space-5);
}

.dossier_logo,
.dossier {
  background-color: rgba(18, 94, 48, 0.9);
  border-radius: 20px;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 10px 12px 14px;
  margin: 10px;
  flex: 1 1 320px;   /* flexible card with a reasonable min width */
  max-width: 100%;
}

.dossier_logo { padding: 10px; }

.dossier_img { width: 100%; }

.imgGateauAnnif35 { height: auto; max-height: 130px; }

.titre_dossier {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 700;
  margin: 10px 0;
  text-align: center;
}

.main_fichier {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 6px;
}

.icone {
  background-color: #fff;
  border-radius: 10px;
  height: 45px;
  width: 45px;
  padding: 5px;
  transition: transform .3s ease, box-shadow .3s ease;
}

.icone:hover, .fichier:hover {
  transform: scale(1.06);
  color: #fff;
}

.fichier {
  background-color: transparent;
  border-radius: 10px;
  padding: 6px 10px;
  color: #fff;
  text-decoration: none;
  font-size: clamp(16px, 2.2vw, 22px);
  transition: color .3s ease, transform .3s ease;
  position: relative;
}

.nouvelle_version {
  background-color: #A9CF37;
  color: #125e30;
  padding: 4px 10px;
  font-size: 0.9rem;
  border-radius: 999px;
  position: absolute;
  margin-left: 10px;
  font-weight: 900;
}

/* Video becomes fluid */
.video {
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  margin: 6px;
}

/* Clean up duplicate .losange rules & make it responsive */
.losange {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 40px;
  flex-wrap: wrap;
}

/* 5) Scrolling banner */
.bandeau {
  width: auto;
  overflow: hidden;
  height: 48px;
  background-color: #f1f1f1;
  padding-left: 50%;
  margin: 20px 30px;
}

.actu {
  display: inline-block;
  height: 48px;
  line-height: 48px;
  white-space: nowrap;
  padding-right: 100%;
  animation: actu 20s linear infinite;
}

.actu_titre {
  display: inline-block;
  padding: 0 22px;
  font-size: clamp(16px, 2.2vw, 22px);
  color: #125e30;
  text-decoration: none;
}

@keyframes actu {
  0% { transform: translate3d(0,0,0); visibility: visible; }
  100% { transform: translate3d(-100%,0,0); }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .actu { animation-duration: 0.001ms; animation-iteration-count: 1; }
}

/* 6) Footer */
.footer {
  background-color: #125e30;
  min-height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;   /* was absolute; avoid overlap on small screens */
  bottom: 0;
  padding: 10px;
}

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

.footer_logo_img {
  height: 48px;
}

/* 7) Visibility tweaks */
.losange_desktop { display: none; }  /* hide desktop-only by default; will show on larger screens */

/* 8) Breakpoints (mobile-first) */

/* ≥ 600px (small tablets) */
@media screen and (min-width: 600px) {
  .search_logo { height: 80px; }
  .header { justify-content: center; }
}

/* ≥ 768px (tablets) */
@media screen and (min-width: 768px) {
  .header { justify-content: space-between; }
  .search_logo { height: 90px; }
  .actu_titre { padding: 0 26px; }
}

/* ≥ 992px (small laptops) */
@media screen and (min-width: 992px) {
  .dossier_logo, .dossier { flex: 1 1 380px; }
  .losange_desktop { display: initial; }
  .search_form { max-width: 560px; }
}

/* ≥ 1200px (laptops/desktops) */
@media screen and (min-width: 1200px) {
  .dossier_logo, .dossier { flex: 1 1 420px; }
  .search_logo { height: 100px; }
}

/* ≥ 1500px (large desktops) */
@media screen and (min-width: 1500px) {
  .container { max-width: 1320px; }
}

/* Ultra-wide screens */
@media screen and (min-width: 2000px) {
  .footer { position: relative; bottom: 0; }
}


/* === User-requested fixes (2025-09-05) === */

/* 1) Icônes Google G-Suite & Logiciels en LIGNE */
.dossier_logo .main_icone,
.dossier .main_icone {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;        /* rester sur une seule ligne sur desktop */
  /*overflow-x: auto;         /* scroll horizontal si ça déborde sur petits écrans */
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
/* éviter que les images rétrécissent de travers */
.main_icone .icone {
  flex: 0 0 auto;           /* largeur fixe, pas de shrink */
  height: 45px;
  width: 45px;
  object-fit: contain;
}

/* 2) "Mission – Vision – Valeurs" sur la même ligne */
.special_ligne {
  display: flex !important;   /* forcer le display flex */
  flex-direction: row !important;
  gap: 15px;
  flex-wrap: nowrap !important;
  justify-content: center;
  align-items: center;
  overflow-x: auto;           /* scroll si écran trop étroit */
  scrollbar-width: thin;
}
/* rendre les liens/blocs uniformes en ligne */
.special_ligne > a.fichier,
.special_ligne > .fichier {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;        /* pas de retour à la ligne dans les libellés */
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
}

/* 3) Image entre Google_GSuite et Logiciel : conserver ratio */
.dossier_img,
.img-keep-ratio,
.between-gsuite-logiciel img {
  width: 100%;
  height: auto;
  object-fit: contain;        /* ne jamais déformer */
  aspect-ratio: auto;         /* laisser le navigateur calculer le ratio */
}

/* Sur très grands écrans, autoriser le wrap pour une meilleure répartition si souhaité */
@media (min-width: 1400px) {
  .dossier_logo .main_icone,
  .dossier .main_icone {
    flex-wrap: nowrap; /* conserver en ligne sur desktop XXL (demande utilisateur) */
  }
}


/* === Refinement (2025-09-05): Better MVV layout + fit-content zones === */

/* 1) "Mission – Vision – Valeurs" : grid cards, clean & ergonomic
      - On desktop: 3 columns (same line)
      - On tablets: 2 columns
      - On mobile: 1 column
*/
.special_ligne {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 14px;
  justify-items: center;
  align-items: stretch;
  overflow: visible !important;     /* no horizontal scroll needed */
  flex-wrap: unset !important;      /* cancel previous flex approach */
}

.special_ligne > .fichier,
.special_ligne > a.fichier {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  white-space: normal;              /* allow wrap inside the card */
  min-height: 48px;
  width: 100%;
  max-width: 420px;                 /* keep a nice readable width */
  transition: transform .2s ease, box-shadow .2s ease;
}

.special_ligne > .fichier:hover,
.special_ligne > a.fichier:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,.12);
}

/* MVV responsive columns */
@media (min-width: 680px) {
  .special_ligne {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}
@media (min-width: 992px) {
  .special_ligne {
    grid-template-columns: repeat(3, minmax(220px, 1fr)); /* same line on desktop */
  }
}

/* 2) Fit-content zones for "Pilotage de l’activité" and "Le groupe Serpe"
      Apply class .zone--fit (or data-fit="true") to those specific blocks in the HTML.
*/
.zone--fit,
.dossier.zone--fit,
.dossier_logo.zone--fit,
[data-fit="true"] {
  display: inline-flex;
  flex-direction: column;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;        /* avoid overflow on very small screens */
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}

/* Ensure inner content doesn't force oversized width */
.zone--fit .fichier { white-space: nowrap; }
.zone--fit .main_fichier { align-items: center; }
