/* ===========================================================
   RESET & BASE
   =========================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --main-bg: #e2e5e7;
  --accent: #3d7d8c;
  --dark: #232c33;
  --white: #fff;
  --orange: #f0852e;
  --border-radius: 16px;
  --shadow: 0 2px 16px rgba(61,125,140,0.08);
  --font-main: 'Montserrat', Arial, sans-serif;
}

html, body {
  padding: 0;
  margin: 0;
  font-family: var(--font-main);
  background: var(--main-bg);
  color: var(--dark);
}

/* Couleurs de fond et police pour body, header et footer */
body { font-family: 'Montserrat', Arial, sans-serif; background: #e2e3e3; color: #162028; }
header, footer { background: #408491; color: #fff; }

/* Liens et boutons d'appel à l'action */
a { color: #408491; text-decoration: none; }
a.cta, .cta-secondary {
  display: inline-block;
  background: #408491;
  color: #fff;
  padding: 0.7em 2em;
  margin-top: 1.5em;
  border-radius: 25px;
  font-weight: bold;
  transition: background 0.2s;
}
a.cta:hover, .cta-secondary:hover { background: #236575; }

/* Header & footer contenus intérieurs */
.header-inner, .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1em 2em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-inner { flex-direction: column; gap: 0.6em; text-align: center; }
.copyright { margin-top: 0.8em; font-size: 0.95em; color: #bfd9e2; }

/* ===========================================================
   HEADER / NAVIGATION
   =========================================================== */
header {
  background: var(--accent);
  color: var(--white);
  padding: 0.5rem 0;
  box-shadow: var(--shadow);
  position: relative; /* nécessaire pour placer le sélecteur de langue absolument */
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2vw;
  position: relative; /* utile pour des éléments absolus dans nav */
}

/* Logo site */
.logo {
  height: 60px;
  width: auto;
  display: block;
  margin-right: 1vw;
}

/* Menu navigation */
.menu {
  list-style: none;
  display: flex;
  gap: 2vw;
  padding: 0;
  margin: 0;
}

.menu li a {
  text-decoration: none;
  color: var(--white);
  font-weight: bold;
  letter-spacing: 1px;
  transition: color 0.2s;
}
.menu li a:hover { color: var(--orange); }
nav ul li a.active, nav ul li a:hover { border-bottom: 2px solid #fff; }

/* ===========================================================
   SÉLECTEUR DE LANGUE (HEADER - EN HAUT À DROITE)
   =========================================================== */
.lang-switch-top {
  display: flex;
  gap: 7px;
  align-items: center;
  position: absolute;
  top: 5px;      /* ajustez selon la hauteur de votre header */
  right: 5px;    /* coin droit du header */
  z-index: 1000;
}
.lang-switch-top a {
  background: #fff;
  border-radius: 7px;
  text-decoration: none;
  font-size: 1.08em;
  padding: 2px 10px;
  opacity: 0.82;
  color: #236575;
  border: 1px solid #e2e3e3;
  font-weight: 600;
  transition: opacity 0.14s, background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 8px #0001;
}
.lang-switch-top a.active,
.lang-switch-top a:hover {
  opacity: 1;
  background: #eaf6fa;
  color: #236575;
}
.lang-switch-top .flag {
  font-size: 1.25em;
  margin-right: 2px;
}

/* ===========================================================
   HERO / ABOUT / MAIN CONTENT
   =========================================================== */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, #4095a3 0%, #e2e3e3 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-logo { width: 140px; margin-bottom: 1em; }
.hero h1 { font-size: 2.7em; letter-spacing: 2px; margin-bottom: 0.3em; }
.slogan { font-size: 1.2em; color: #246272; }
.about {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 3px 15px rgba(64,133,145,0.07);
  padding: 2em;
  max-width: 800px;
  margin: -4em auto 3em;
  text-align: center;
}
.about h2 { color: #246272; margin-bottom: 1em; }
.cta-secondary { background: #246272; color: #fff; margin-top: 1em; }

/* ===========================================================
   GRILLE PRESTATIONS
   =========================================================== */
main {
  max-width: 1100px;
  margin: 2rem auto 2rem auto;
  padding: 0 2vw;
}
.grid-prestations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.prestation {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: left;
  border-left: 7px solid var(--accent);
}
.prestation h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.3rem;
}
.prestation p {
  margin: 0.7rem 0 0;
  color: var(--dark);
  font-size: 1rem;
}

/* ===========================================================
   BLOG (PAGE ACTU)
   =========================================================== */
/* Conteneur principal qui limite la largeur totale sur grand écran */
.blog-actu {
    max-width: 1200px;         /* Largeur max de la colonne centrale */
    margin: 3em auto 2em auto; /* Centrage + marges haut/bas */
    padding: 0 1.5em;          /* Espace sur les côtés */
    box-sizing: border-box;    /* Inclut le padding dans la largeur */
}


/* BULLE D'ARTICLE : structure et taille */
.blog-post {
    background: #fff;              /* Fond blanc */
    margin-bottom: 2.2em;          /* Espace entre chaque bulle */
    padding: 2.2em 2.2em 1.7em 2.2em; /* Espace interne (haut, côtés, bas) */
    border-radius: 1.3em;          /* Coins arrondis */
    border: none;                  /* Pas de bordure */
    box-shadow: 0 2px 14px #0002;  /* Ombre portée légère */
    width: 100%;                   /* Prend toute la largeur du conteneur parent */
    max-width: 1000px;             /* Mais ne dépasse jamais 1000px (mode paysage sur PC) */
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;        /* Contenu vertical (titre, images, texte, date) */
    overflow: visible;             /* Ne coupe rien à l’intérieur (sauf si besoin) */
    box-sizing: border-box;
    /* Aucun min-height, ni aspect-ratio, ni height fixe : la bulle s’adapte à la longueur du contenu */
}

/* Conteneur images, côte à côte et wrap si trop large */
.blog-images {
    display: flex;
    flex-wrap: nowrap;           /* Passe à la ligne si trop d’images=wrap et toutes les images sur la même ligne nowrap */
    gap: 0.5em;                  /* Espace entre images */
    margin-bottom: 1.2em;
    justify-content: center;   /* Centrer les images dans la bulle */
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;      /* Si trop serré, scroll horizontal en secours */
    scrollbar-color: #d2d2d2 #fafafa;
}

/* IMAGE : toujours visible, jamais rognée (contain) */
.blog-img {
  /*  width: 100%;               Prend toute la largeur possible du flex-item */
 /*   max-width: 320px;          Jamais plus large que 320px */
 /*   min-width: 50px;          Jamais plus petite que 50px */
    height: auto;              /* Hauteur auto pour ne pas déformer */
    border-radius: 1em;
    box-shadow: 0 1px 10px #0001;
    object-fit: contain;       /* S’adapte au cadre sans cropper (blanc autour si format image ≠ format cadre) */
    display: block;
    margin-bottom: 1em;
    overflow: hidden;
	flex: 1 1 0;         /* <-- Toutes prennent la même largeur */
    max-width: 100%;
    min-width: 0;
}

/* --------- RESPONSIVE DESIGN ----------- */

/* < 1100px : pour PC moyen, tablettes, etc. */
@media (max-width: 1100px) {
  .blog-post { max-width: 98vw; padding: 1em 0.6em 1em 0.6em; }
/* On retire le passage en colonne pour .blog-images */
/*   .blog-images { gap: 0.7em; } */
  .blog-img { max-width: 95vw; }
}

/* < 700px : mode portrait (mobile) */
@media (max-width: 700px) {
  .blog-post { padding: 0.8em 0.3em; max-width: 99vw; }
   /* On retire le passage en colonne pour .blog-images */
  /* .blog-images { flex-direction: column; align-items: center; } */
  .blog-img { max-width: 95vw; }
}

/* TEXTE DE L’ARTICLE */
.blog-content {
    font-size: 1.09em;
    margin-bottom: 1.2em;
    line-height: 1.7;
    flex: 1 1 auto; /* Pour que la date reste en bas si y’a peu de texte */
}

/* DATE (tjr alignée à droite, en bas du contenu) */
.blog-date {
    color: #777;
    font-size: 0.98em;
    text-align: right;
    margin-top: 1em;
    margin-bottom: 0;
    align-self: flex-end;
}

/* Alignements spécifiques images, si tu les utilises */
.img-left   { align-self: flex-start; }
.img-right  { align-self: flex-end; margin-left:auto;}
.img-center { align-self: center; margin-left:auto; margin-right:auto; }

/* Pour s’assurer que rien ne déborde des bulles */
.blog-post, .blog-images, .blog-img { overflow: hidden; }

@media (max-width: 700px) {
  .header-inner, .footer-inner, nav {
    flex-direction: column !important;
    gap: 1em;
    align-items: stretch;
    width: 100%;
  }
  .menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  .menu li {
    flex: 1 1 50%;    /* 2 colonnes si possible, sinon à la ligne */
    text-align: center;
    margin-bottom: 0.2em;
  }
  .lang-switch-top {
    position: static !important;
    margin: 0.7em auto 0 auto;
    width: 100%;
    justify-content: center;
  }
}

/* ===========================================================
   CONTACT
   =========================================================== */
.contact-form {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 420px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.contact-form label { font-weight: bold; color: var(--accent); }
.contact-form input, .contact-form textarea {
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #b4c5cc;
  font-size: 1rem;
  font-family: var(--font-main);
}
.contact-form button {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s;
}
.contact-form button:hover { background: var(--orange); }

.contact-info {
  max-width: 400px;
  margin: 2rem auto;
  text-align: left;
  font-size: 1.05rem;
  color: var(--dark);
  background: #f6f8f9;
  padding: 1.3rem 1.5rem;
  border-radius: var(--border-radius);
}

/* ===========================================================
   FOOTER
   =========================================================== */
footer {
  background: var(--accent);
  color: var(--white);
  text-align: center;
  padding: 1rem 0 0.6rem 0;
  margin-top: 3rem;
  border-top-left-radius: 60px 28px;
  border-top-right-radius: 60px 28px;
  font-size: 0.98rem;
}

/* ===========================================================
   ADMIN (gestion drag & drop, backoffice)
   =========================================================== */
.article-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0;
}
.article-list li {
    background: #f3f9f5;
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    border: 1.5px solid #b5d5c5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    cursor: grab;
}
.article-list li .title { font-weight: 600; color: var(--accent, #408491);}
.article-list li .date { color: #888; font-size: 0.93em;}
.article-actions a {
    color: #fff;
    background: #d1442a;
    text-decoration: none;
    border-radius: 0.7rem;
    padding: 0.4rem 0.9rem;
    margin-left: 0.7rem;
    font-weight: 500;
}
.article-actions a.edit { background: #30824e;}
.article-actions a.delete { background: #d1442a;}
.drag-handle { font-size: 1.4em; margin-right: 0.8em; color: var(--accent, #408491);}

/* ===========================================================
   RESPONSIVE DESIGN
   =========================================================== */
@media (max-width: 800px) {
  .header-inner, .footer-inner { flex-direction: column; gap: 1em; padding: 1em; }
  nav ul { gap: 1em; }
  .about, .hero { padding: 1.5em 1em; }
  .hero h1 { font-size: 2rem; }
  .intro, main { padding: 1rem; }
  .grid-prestations { gap: 1rem; }

  /* Blog responsive */
  .blog-actu { padding: 0 0.4em; }
  .blog-post { padding: 1.1em 0.6em 1em 0.6em; border-radius: 0.9em; max-width: 99vw;}
  .blog-images { gap: 0.6em; }
  .blog-img { max-width: 99vw; min-width: 100px; max-height: 230px; }
}
@media (max-width: 570px) {
  .blog-actu { padding: 0 0.2em; }
  .blog-post { padding: 0.7em 0.1em; border-radius: 0.7em; max-width: 99vw; }
  .blog-images { flex-wrap: wrap; justify-content: center; }
  .blog-img { max-width: 98vw; min-width: 80px; max-height: 160px;}
  .intro, main, .contact-info { padding: 1rem; }
  .logo { height: 45px; }
  .menu { gap: 1rem; }
  .hero-logo { max-width: 85px; }
}
@media (max-width: 650px) {
    .blog-container {
        padding: 0.7rem;
        border-radius: 1.1rem;
    }
    .blog-post {
        padding: 1em 0.6em;
        border-radius: 0.8em;
    }
}

.lang-switch-top {
  display: flex;
  gap: 7px;
  align-items: center;
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1000;
}

/* Responsive : sur mobile, on place en-dessous et centré */
@media (max-width: 700px) {
  .lang-switch-top {
    position: static !important;
    justify-content: center;
    margin: 1em auto 0 auto;
    top: unset; right: unset;
    width: 100%;
  }
}