/* ============================
   VARIABLES CSS
============================ */
:root {
  --font-body: "Corbel", "Poppins", "Segoe UI", sans-serif;
  --font-title: "Merienda", cursive;
  --color-bg: hsla(207, 54%, 78%, 0.187);
  --color-bg-50: rgba(33, 98, 202, 0.317);
  --color-text: #1e0f80;
  --color-title: #09236b;
  --color-link: #c66325;
  --color-link-hover: #d3ed12;
  --color-details-bg: transparent;
  --color-details-open: rgba(161, 208, 213, 0.125);

  --radius: 10px;
  --shadow: 0 0 10px rgba(95, 93, 93, 0.05);
}

/* ============================
   CONTAINER
============================ */
.art {
  display: block;
  font-family: var(--font-body);
  /*font-size: clamp(16px, 1.1vw, 3em);*/
  font-size: clamp(14px, 1vw, 2em);
  /* ↓ taille de base */
  /* adaptatif */
  background-color: var(--color-bg);
  color: var(--color-text);
  padding: clamp(10px, 3.5vw, 25px);
  margin: clamp(2.5px, 1vw, 2.5px);
  line-height: 1.7;
  /* aération du texte */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  box-sizing: border-box;

  /* Limite la largeur pour un meilleur confort de lecture */
  max-width: 900px;
  margin: 0 auto;
  /* centre horizontalement le conteneur .art lui-même */

  /* NOUVEAU : Centre les éléments en ligne (dont les images) dans .art */
  text-align: center;

  /* Transition douce sur fond et couleur */
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media screen and (max-width: 768px) {
  .art {
    max-width: 100%;
    padding: 15px;
  }
}

/* ============================
   TITRES AVEC ANIMATION
============================ */
.art h1,
.art h2,
.art h3,
.art h4,
.art h5,
.art h6 {
  font-family: var(--font-title);
  color: var(--color-title);
  margin-bottom: 0.5em;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease;
}

.art h1 {
  font-size: clamp(1.4em, 3vw, 1.8em);
}

.art h2 {
  font-size: clamp(1.2em, 2.5vw, 1.5em);
}

.art h3 {
  font-size: clamp(1.1em, 2vw, 1.4em);
}

.art h4 {
  font-size: clamp(1em, 1.8vw, 1.3em);
}

.art h5 {
  font-size: clamp(1em, 1.6vw, 1.2em);
}

.art h6 {
  font-size: clamp(1em, 1.4vw, 1.1em);
}

.art h1:hover,
.art h2:hover,
.art h3:hover,
.art h4:hover,
.art h5:hover,
.art h6:hover {
  transform: translateX(5px);
  color: var(--color-link-hover);
}

/* ============================
   TEXTE & LIENS
============================ */
.art p {
  font-size: clamp(1em, 1.2vw, 1.01em);
  line-height: 1.5;
  margin-bottom: 1em;
  text-size-adjust: 100%;
  text-align: justify;
  text-justify: auto;
}

.art a {
  color: var(--color-link);
  text-decoration: underline;
  transition: all 0.3s ease;
}

.art a:hover {
  color: var(--color-link-hover);
  text-decoration: wavy underline;
}

/*=============================
|  IMAGES (Optimisé)
=============================*/
.art img {
  /* display: block; SUPPRIMÉ - Laisse l'image en inline/inline-block */
  margin: 5px 0;
  /* Marge verticale OK, centrage horizontal géré par text-align: center sur .art */
  padding: 2px;
  text-align: center;
  max-width: 100%;
  /* Responsive : ne dépasse pas le conteneur */
  height: auto;
  /* Conserve les proportions */
  border-radius: 5px;
  /* Optionnel : arrondi harmonieux */
}

/* Centrage horizontal + vertical (dans un bloc dédié) */
/* Ce wrapper est toujours utile pour les cas complexes (centrage vertical) */
.image-wrapper {
  display: flex;
  justify-content: center;
  /* centre horizontalement */
  align-items: center;
  /* centre verticalement */
  min-height: 200px;
  /* hauteur du bloc */
  text-align: initial;
  /* Rétablit l'alignement pour ne pas affecter les éléments flex */
}

.article__text--centre {
  text-align: center;
}

/* ============================
   BLOCS DETAILS
============================ */
.art details {
  background-color: var(--color-details-bg);
  border-left: 2px solid #121495;
  border-radius: 5px;
  margin-bottom: 10px;
  padding: 5px;
  transition: all 0.3s ease;
}

.art summary {
  cursor: pointer;
  font-size: clamp(0.95em, 2vw, 1.15em);
  font-weight: bold;
  font-family: var(--font-title);
  color: darkblue;
  text-align: left;
  transition: all 0.3s ease;
}

.art details[open] {
  background-color: var(--color-details-open);
}

.art details[open] summary {
  color: var(--color-link);
}

/* ============================
   CADRE AVEC FLÈCHE PIVOTANTE
============================ */
.art summary.cadre {
  display: inline-block;
  position: relative;
  padding-left: 1.5em;
  min-width: 100px;
  max-width: 90%;
  margin: auto;
  border: 1px solid #1e0d46;
  background-color: var(--color-bg-50);
  text-align: center;
  line-height: normal;
}

.art summary.cadre::before {
  content: "▶";
  position: absolute;
  left: 0.4em;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transform-origin: center;
  transition: all 0.3s ease;
  color: var(--color-link);
}

.art details[open] summary.cadre::before {
  transform: translateY(-50%) rotate(90deg);
  color: var(--color-link-hover);
}

.art summary.cadre:hover {
  transform: translateX(5px);
  color: var(--color-link-hover);
}

/* ============================
   TABLEAUX
============================ */
.art table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95em;
  background-color: var(--color-bg);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.art th,
.art td {
  padding: 12px 15px;
  border: 1px solid #ddd;
  text-align: left;
  transition: background-color 0.3s ease;
}

.art th {
  background-color: var(--color-bg);
  color: var(--color-title);
  font-weight: bold;
}

.art tr:nth-child(even) td {
  background-color: var(--color-bg);
}

.art tr:hover td {
  background-color: var(--color-details-open);
}

/* ============================
   RESPONSIVE
============================ */
@media screen and (max-width: 768px) {
  .art table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
