/* Reset et base */
* {
  box-sizing: border-box;
}
html {
  color-scheme: light !important;
  -webkit-color-scheme: light !important;
  forced-color-adjust: none !important;
  background-color: #fff !important;
}

body {
  background-color: #fff !important;
  color: #000 !important;
}

html, body, a {       
  overflow-x: hidden;
  font-family: 'Lato', sans-serif;
  font-size: clamp(16px, 2.5vw, 20px);
  margin: 0;
  height: 100%;
  text-transform: none;
  border: 0;
  line-height: 1.6;
}

/* Amélioration pour les écrans tactiles */
button, a, .filter-btn {
  min-height: 44px;
  min-width: 44px;
}

header, footer {
  padding: clamp(1rem, 3vw, 1.5rem);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav li {
  display: inline-block;
  margin: 0.5rem;
}

a {
  text-decoration: none;
  display: inline-block;
  padding: 0.5rem;
}

article {
  background: white;
  padding: clamp(0.5rem, 2vw, 1rem);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  margin-bottom: 1rem;
}

article:hover {
  transform: translateY(-5px);
}

/* Images et médias responsives */
img, video, iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 0.5rem;
  display: block;
}

h2 {
  margin-top: 0.5rem;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: #1033cc;
}

h5 {
  font-weight: unset;
  margin: 0 0.5em;
}

button {
  background-color: white;
  border: 1px solid #ccc;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 4px;
}

.wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.page-body {
  padding: clamp(10px, 3vw, 20px);
}

.page-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 10em;
  padding: clamp(10px, 3vw, 20px);
  position: relative;
}

.page-header > .logo {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(200px, 80vw);
}

.page-header ul {
  align-self: flex-start;
  position: absolute;
  bottom: 0;
  right: 20px;
}

/* ============= MENU HAMBURGER ============= */

.main-nav {
  /* pour desktop, on laisse le comportement actuel : ul positionné en bas à droite */
}

/* Bouton hamburger : caché par défaut (desktop) */
.nav-toggle {
  display: none; /* visible seulement en mobile via media query */
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle:focus-visible {
  outline: 2px solid #1033cc;
  outline-offset: 2px;
}

/* Barres du hamburger */
.nav-toggle-bar {
  position: absolute;
  width: 1.35rem;
  height: 2px;
  background: #000;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.nav-toggle-bar:nth-child(1) {
  top: 0.75rem;
}

.nav-toggle-bar:nth-child(2) {
  top: 1.05rem;
}

.nav-toggle-bar:nth-child(3) {
  top: 1.35rem;
}

/* État "menu ouvert" : croix */
.page-header.is-menu-open .nav-toggle-bar:nth-child(1) {
  top: 1.05rem;
  transform: rotate(45deg);
}

.page-header.is-menu-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.page-header.is-menu-open .nav-toggle-bar:nth-child(3) {
  top: 1.05rem;
  transform: rotate(-45deg);
}


li .active {
  color: #1033cc;
  font-weight: bold;
}

li a:hover, li a:focus {
  color: #1033cc;
  outline: 2px solid transparent;
}

.page-header h1 {
  align-self: flex-start;
  position: absolute;
  bottom: 0;
  left: 20px;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.logo {
  max-width: 200px;
}

.center-text {
  text-align: center;
}
.inline_block {
  display: inline-block;
}

.media-type-selector {
  margin: 1rem 0;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 8px;
}

.media-type-selector label {
  margin-right: 1rem;
  cursor: pointer;
  display: inline-block;
  padding: 0.5rem;
}

.media-input {
  display: none;
}

.media-input.active {
  display: block;
}

.error {
  color: #c33;
  background: #ffe6e6;
  padding: 0.5rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.youtube-preview {
  width: 100%;
  height: 150px;
  border: none;
  margin: 1rem 0;
}

/* ===== GALLERY ET CARTES ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(406px, 100%), 1fr));
  gap: clamp(0.5rem, 2vw, 1rem);
  max-width: 1220px;
  margin: auto;
  padding: 0 1rem;
}

.gallery .item {
  display: block;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
  background: white;
}

.gallery .item.hidden {
  display: none;
}

.gallery .item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: all 0.3s ease;
}

.gallery .item:hover img {
  transform: scale(1.02);
  filter: brightness(1.1);
}

/* Contenu des cartes avec espace pour les catégories */
.gallery .item .card-content {
  padding: 1rem;
  padding-bottom: 3rem; /* Espace réservé pour les catégories */
}

.gallery .item > h2,
.gallery .item > p,
.gallery .item > div:not(.card-categories) {
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

.gallery .item > h2 {
  padding-top: 1rem;
}

small a {
  height: 0 !important;
}
/* ===== CATÉGORIES EN BAS À DROITE ===== */
.card-categories {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  z-index: 10;
  justify-content: flex-end; /* Alignement à droite */
  max-width: calc(100% - 2rem); /* Évite le débordement */
}

.card-categories span {
  color: rgba(16, 51, 204, 0.9);
  padding: 0.2rem 0.6rem;
  font-weight: 500;
  line-height: 0;
}


/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-image, .lightbox-media {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
  transform: scale(1);
}
.lightbox-overlay.active .lightbox-media {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  padding: 10px;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-info {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  color: white;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 20px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.lightbox-info h3 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
  color: white;
}

.lightbox-info p {
  margin: 0;
  opacity: 0.8;
  font-size: 0.9rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  font-size: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.zoom-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.gallery .item:hover .zoom-indicator {
  opacity: 1;
}

body.lightbox-open {
  overflow: hidden;
}

/* ===== FILTRES ===== */
.filter-buttons {
  width: 100%;
  max-width: 18em;
  padding: 0.5em;
  margin: auto;
  text-align: center;
}

.filter-btn {
  cursor: pointer;
  border: none;   
  font-size: clamp(14px, 2.5vw, 16px);
  appearance: none;
  background: transparent;
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn:focus {
  color: #1033cc;
  background: rgba(16, 51, 204, 0.1);
  outline: none;
}

.filter-btn.active {
  color: #1033cc;
  font-weight: bold;
  background: rgba(16, 51, 204, 0.1);
}

/* ===== SECTIONS COLORÉES ===== */
.black-section {
  background-color: black;
  color: white;
  padding: clamp(1.5em, 4vw, 2.5em);
}  

.black-section h2 {
  color: white;
  font-weight: unset;
}

.blue-section {
  background-color: #1033cc;
  color: white;
  padding: clamp(1.5em, 4vw, 2.5em);
}

.blue-section h2 {
  color: white;
  font-weight: unset;
}

.icons {
  max-width: min(150px, 80vw);
  margin: auto;
  height: auto;
}

.col-3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: auto;
  gap: 5.5rem;
  padding: 4rem 0;
}

.services {
  margin: 0 1em;
  padding-bottom: 1em;
  flex: 1;
  min-width: 0;
  width: 100%;
}
  .services img {
    width: fit-content;
    height: 123px;
    margin: auto;
  }
.contact_section {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}
    .contact_section::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: rgba(255, 255, 255, 0.1);
          backdrop-filter: blur(10px);
          z-index: 1;
    }

    .contact_section > * {
        position: relative;
        z-index: 2;
    }
    .contact_section > * {
        position: relative;
        z-index: 2;
    }

    .contact_section-content {
        text-align: center;
    }

    .contact_section h2 {
        font-size: 3rem;
        font-weight: 300;
        margin-bottom: 20px;
        font-style: italic;
    }

    .contact_section > p:first-of-type {
        font-size: 1.2rem;
        font-weight: 300;
        opacity: 0.9;
    }

    .contact_section-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .contact_section > p:not(:first-of-type) {
        margin: 0;
    }

    .contact_section a {
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 12px 20px 12px 60px;
        border-radius: 25px;
        text-decoration: none;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        display: inline-block;
        white-space: nowrap;
        position: relative;
    }

    .contact_section a::before {
      content: '';
        position: absolute;
        left: 1px;
        top: 50%;
        transform: translateY(-50%);
        width: 50px;
        height: 50px;
        -webkit-text-fill-color: #1033cc;
        font-weight: bold;
        background: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .contact_section a#mail::before {
        content: '✉';
    }
    .contact_section a#tel::before {
            content: '🖁';
        }


    .contact_section a:hover {
        background: rgba(0, 0, 0, 0.9);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
.medias {
  flex-wrap: wrap;
  display: flex;
  max-width: 1200px;
  padding: clamp(1.5em, 4vw, 2.5em);
  gap: 60px;
  align-items: flex-start;
}
.flex {
            flex: 1;
        }

.logo_media {
  max-width: 100%;
    flex: 0 0 250px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    height: 200px;
}

.logo_media img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.medias > .flex {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    align-self: flex-start;
}

.medias p {
    color: #666;
    line-height: 1.6;
    margin-top: 15px;
    font-size: 1rem;
    font-weight: normal;
}

.medias a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.medias a:hover {
    color: #1033cc;
}
.page-footer a{
  color: white !important;
}
/* ===== MEDIA QUERIES ===== */

/* Tablettes */
@media screen and (max-width: 768px) {
  .page-header {
    flex-direction: column;
    height: auto;
    min-height: auto;
    text-align: center;
  }
  
  .page-header > .logo,
  .page-header h1,
  .page-header ul {
    position: static;
    transform: none;
    margin: 1rem 0;
  }
  
  .col-3 {
    flex-direction: column;
    align-items: center;
  }
  
  .services {
    margin: 0;
    text-align: center;
    min-width: 100%;
  }
  
  nav li {
    display: block;
    margin: 0.5rem 0;
  }
  
  .lightbox-image, .lightbox-media {
    max-width: 95vw;
    max-height: 85vh;
  }
  
  .lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
    width: 50px;
    height: 50px;
  }
  
  .lightbox-info {
    bottom: 10px;
    left: 10px;
    right: 10px;
    padding: 10px 15px;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  /* Afficher le bouton hamburger sur mobile */
  .nav-toggle {
    display: flex;
    margin-top: 0.5rem;
  }

  /* Le nav n'est plus visible par défaut en mobile */
  .main-nav {
    display: none;
    width: 100%;
  }

  /* Quand le JS ajoute .is-open, on affiche le menu */
  .main-nav.is-open {
    display: block;
  }

  /* Le UL du menu passe en colonne, centré */
  .main-nav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0.5rem 0 1rem;
  }

  .main-nav a {
    width: 100%;
    text-align: center;
  }
}

/* Smartphones */
@media screen and (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }
  
  .filter-buttons {
    width: 100%;
  }
  
  .filter-btn {
    display: block;
    width: 100%;
    margin: 0.25rem 0;
  }
  
  .page-body {
    padding: 10px;
  }
  
  .media-type-selector label {
    display: block;
    margin: 0.5rem 0;
  }
  
  .card-categories {
    bottom: 0.5rem;
    right: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .card-categories span {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }
}

/* Écrans larges - Maximum 3 colonnes */
@media screen and (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
  }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  article:hover {
    transform: none;
  }
  
  .gallery .item:hover img {
    transform: none;
  }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #ffffff;
  }
  
  article, .gallery .item {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #555;
  }
  
  button {
    background-color: #2a2a2a;
    color: #ffffff;
    border-color: #555;
  }
}

/* Support pour les écrans haute résolution */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}


/* ===== MEDIA QUERIES COMPLÉMENTAIRES POUR COMPORTEMENT RESPONSIVE ===== */
@media screen and (max-width: 768px) {
  /* Correction pour .medias */
  .medias {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
  }

  .logo_media {
    justify-content: center;
  }

  .medias .flex {
    width: 100%;
  }

  /* Correction pour .contact_section (bloc "Un projet en tête ?") */
  .contact_section {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .blue-section-buttons {
    align-items: center;
  }

  /* Footer responsive */
  .page-footer {
    text-align: center;
  }

  .page-footer .inline_block,
  .page-footer nav ul {
    display: block;
    margin: 1rem 0;
  }

  .page-footer nav ul li {
    display: block;
    margin: 0.5rem 0;
  }
}

/* ===== LIGHTBOX (restauration complète sans interférence) ===== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

body.lightbox-open {
  overflow: hidden;
}

/* forcer le mode light*/
@media (prefers-color-scheme: dark) {
  html, body {
    background-color: #fff !important;
    color: #000 !important;
  }
}

:root {
  -webkit-color-scheme: light;
}
