/* ================================
   RESET SAFE
================================ */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* bloque uniquement le scroll horizontal */
}

/* ================================
   CONTENEUR PRINCIPAL
================================ */
.content_salle_histoire{
  max-width: 1000px;
  margin: 2.5rem auto;
  padding: 2rem;

  display: flex;
  align-items: flex-start;
  gap: 2rem;

  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.04));
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  border-radius: 8px;
  opacity: 1;
}

/* ================================
   FOND
================================ */
.fond-salle-histoire {
  background-image: url("../images/fonds/fond_salle_histoire.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #fff;
}

/* ================================
   SECTIONS
================================ */
.histoire-sections {
  margin-top: 3rem;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}

/* ================================
   CARDS
================================ */
.histoire-card {
  background: rgba(0,0,0,0.35);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  color: #fff;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.histoire-card img {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
  display: block;
}

/* Hover */
.histoire-card:hover {
  color: #011111;
  transform: translateY(-8px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.7);
  background: rgba(255,255,255,0.08);
}

/* ================================
   MOBILE GLOBAL
================================ */
@media (max-width: 768px) {

  /* Fond corrigé */
  .fond-salle-histoire {
    background-attachment: scroll;
  }

  /* Conteneur allégé */
  .content_salle_histoire {
    padding: 1rem;
    margin: 0.5rem auto;
    border-radius: 0;
    box-shadow: none;

    align-items: flex-start;
  }

  /* Sections */
  .histoire-sections {
    margin-top: 1rem; /* remonte les icônes */
    width: 100%;
    align-items: center;
    justify-content: center;
  }

  /* Texte supprimé */
  .histoire-card h3,
  .histoire-card p {
    display: none;
  }

  /* Cartes simplifiées */
  .histoire-card {
    padding: 1rem;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  /* Icônes */
  .histoire-card img {
    width: 100px;
    height: 100px;
    margin: 0 auto;
  }

  /* Feedback tactile */
  .histoire-card:active {
    transform: scale(0.9);
  }
}

/* ================================
   PORTRAIT → COLONNE
================================ */
@media (max-width: 768px) and (orientation: portrait) {
  .histoire-sections {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
}

/* ================================
   PAYSAGE → LIGNE
================================ */
@media (max-width: 768px) and (orientation: landscape) {
  .histoire-sections {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2rem;
  }
}