:root {
  --vert1: #37633F;
  --vert2: #67944C;
  --vert3: #A3C651;
  --beige: #EFE3C5;
  --rouge: #B84446;
  --beige-clair: #f9f6ef;
}

body {
  font-family: 'Averia Libre', sans-serif;
  margin: 0;
  background: var(--beige) 
              url("img/layout/frise.png") repeat-y left top,
              url("img/layout/frise.png") repeat-y right top;
  color: var(--vert1);
  line-height: 1.6;
}

/* header */
header.banner {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--vert1);
  color: var(--beige);
}
header h1 {
  margin: 0;
  font-family: 'EB Garamond', serif;
  font-size: 2.5rem;
  color: var(--vert3);
}
.tagline {
  margin: 0.5rem 0 0;
  color: var(--rouge);
  font-weight: bold;
}

/* menu */
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  background: var(--vert2);
  padding: 0.5rem;
}
.menu a {
  color: var(--beige);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  transition: background 0.3s;
}
.menu a:hover {
  background: var(--rouge);
  color: white;
}

/* --- Lien actif dans le menu --- */
.menu a.active {
  background: var(--rouge);
  color: white;
  font-weight: bold;
}

/* layout deux colonnes */
.layout {
  display: flex;
  max-width: 1200px;
  margin: auto;

  border-left: 50px solid transparent;
  border-right: 50px solid transparent;

  border-image-source: url("img/layout/frise.png");
  border-image-slice: 50 fill;
  border-image-repeat: repeat;
  background: var(--beige-clair);
}

.sidebar {
  flex: 0 0 250px;
  background: transparent;
  padding: 1rem;
  border-right: 3px solid var(--rouge);
  order: 1;
}

.content {
  flex: 1;
  background: transparent;
  padding: 1.2rem;
  order: 2;
}

/* Mobile : frise fine */
@media (max-width: 768px) {
  .layout {
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;

    border-image-source: url("img/layout/frise-mobile.png");
    border-image-slice: 15 fill;
    border-image-repeat: repeat;
  }
}

/* Responsive : colonnes en pile */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    border-left: none;
    border-right: none;
  }
  .content {
    order: 1; /* contenu principal en haut */
  }
  .sidebar {
    order: 2; /* sidebar en dessous */
    border-right: none;
    border-top: 3px solid var(--rouge);
  }
}

/* Lettrine (première lettre du premier paragraphe) */
.content p:first-of-type::first-letter {
  float: left;
  font-size: 2.8rem;
  line-height: 1;
  margin-right: 0.3rem;
  font-weight: bold;
  color: var(--rouge);
  font-family: 'EB Garamond', serif;
}

/* Fleurons autour des titres */
h2::before, h2::after {
  content: " ❦ ";
  color: var(--vert2);
  font-family: 'EB Garamond', serif;
  font-weight: normal;
}

/* --- Fleurons personnalisables --- */
.fleuron {
  display: inline-block;
  font-family: 'EB Garamond', serif;
  font-weight: normal;
  margin: 0 0.2em; /* petit espace autour */
}

/* Couleurs selon variable CSS */
.fleuron.vert1 { color: var(--vert1); }
.fleuron.vert2 { color: var(--vert2); }
.fleuron.vert3 { color: var(--vert3); }
.fleuron.rouge { color: var(--rouge); }
.fleuron.beige { color: var(--beige); }
.fleuron.beige-clair { color: var(--beige-clair); }

/* Tailles personnalisables */
.fleuron.small  { font-size: 0.8em; }
.fleuron.medium { font-size: 1em; }
.fleuron.large  { font-size: 1.5em; }
.fleuron.xlarge { font-size: 2em; }


/* footer */
footer {
  text-align: center;
  font-size: 0.8rem;
  background: var(--vert1);
  color: var(--beige);
  padding: 1rem;
  line-height: 1.4;
}
footer p {
  margin: 0.3rem 0;
}
footer .legal {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.3;
}

/* --- Publications en cartes --- */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.card {
  background: var(--beige-clair, #f9f6ef);
  border: 1px solid #ddd;
  border-radius: 15px;
  padding: 20px;
  text-decoration: none;
  color: var(--vert1, #37633F);
  transition: transform 0.3s, box-shadow 0.3s;
  display: block;
  font-size: 0.85rem; /* texte global plus petit, ajuste selon tes besoins */
}


.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.card h3 {
  margin-top: 0;
  color: var(--rouge, #B84446);
}

.card p {
  margin: 5px 0;
}

/* --- Image des cartes --- */
.card img {
  display: block;
  width: 100%;           /* l'image remplit horizontalement le conteneur */
  max-width: 150px;      /* limite de largeur */
  object-fit: cover;     /* recadre l'image pour remplir sans déformer */
  border-radius: 10px;   /* coins arrondis */
  margin: 0 auto 10px;   /* centre et espace sous l'image */
}

/* --- Suppression de la lettrine uniquement pour les cartes --- */
.card p:first-of-type::first-letter {
  all: unset;
}

/* --- Formulaire compact et responsive --- */
/* --- Bloc contact dans la colonne content --- */
.contact-box {
  background: var(--beige-clair, #f9f6ef);
  border: 1px solid #ddd;
  border-radius: 15px;
  padding: 20px;
  /* supprime max-width et margin auto pour ne pas casser la colonne */
  width: 100%; /* prend toute la largeur de la colonne */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-family: 'Averia Libre', sans-serif;
  text-align: left; /* à gauche pour respecter le flow de la colonne */
}

.contact-box h2 {
  color: var(--rouge, #B84446);
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.contact-box p,
.contact-box ul li {
  margin-bottom: 10px;
  line-height: 1.5;
  color: var(--vert1, #37633F);
}

.contact-box a {
  color: var(--rouge, #B84446);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-box a:hover {
  color: var(--vert2, #67944C);
}

.contact-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 15px;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-list img {
  width: 24px;
  height: 24px;
}

/* Responsive */
@media screen and (max-width: 500px) {
  .contact-box h2 {
    font-size: 1.3rem;
  }

  .contact-box p,
  .contact-list li {
    font-size: 0.9rem;
  }
}
/* Images */
.img-center,
.img-left,
.img-right {
  border-radius: 12px; /* coins arrondis */
  overflow: hidden;    /* pour éviter que l’image dépasse */
}

.img-center {
  display: block;
  margin: 1em auto;
  max-width: 80%;
}

.img-left {
  float: left;
  margin: 0 1em 1em 0;
  max-width: 45%;
}

.img-right {
  float: right;
  margin: 0 0 1em 1em;
  max-width: 45%;
}

/* Pour petits écrans : les images reprennent toute la largeur */
@media (max-width: 768px) {
  .img-left,
  .img-right,
  .img-center {
    float: none;
    display: block;
    margin: 1em auto;
    max-width: 90%;
  }
}

/*BD cartes*/
.bd-card {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: white;
  border: 1px solid var(--vert2);
  border-radius: 8px;
}

.bd-card img {
  width: 150px;
  height: auto;
  border: 2px solid var(--rouge);
  border-radius: 5px;
}

.bd-info {
  flex: 1;
}

.bd-info h3 {
  margin-top: 0;
  color: var(--rouge);
  font-family: 'EB Garamond', serif;
}

.bd-info p {
  margin: 0.3rem 0;
}

/* Désactive la lettrine dans les cartes BD */
.bd-card p:first-of-type::first-letter {
  all: unset;
}


/* Mobile : cartes en colonne */
@media (max-width: 768px) {
  .bd-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bd-card img {
    margin-bottom: 0.8rem;
  }

  .bd-info {
    text-align: left;
  }
}
