/* ================================
   Typographies & Variables globales
   ================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Inter:wght@300;400;600&display=swap');

:root {
  --primary-color: #14213D;
  --primary-soft: #1F3C88;
  --secondary-color: #FCA311;
  --background-color: #F5F7FA;
  --text-color: #222222;
  --border-color: #D4D7E0;
  --overlay-color: rgba(10, 16, 35, 0.45);

  --max-width: 1080px;
}

/* ================================
   Reset & Base
   ================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* IMPORTANT: évite les images étirées */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================================
   Typographie
   ================================ */

h1, h2, h3, h4 {
  font-family: 'Merriweather', serif;
  color: var(--primary-color);
  margin: 0.5em 0;
}

p {
  margin: 0.6em 0;
  line-height: 1.6;
}

.text-justify { text-align: justify; }
.text-center  { text-align: center; }

/* Liens */
a {
  color: var(--primary-soft);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ================================
   Layout général
   ================================ */

main {
  flex: 1;
  padding: 0 16px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-section {
  padding: 40px 0;
}

/* ================================
   Header & Navigation
   ================================ */

header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

/* Bloc logo + nom centré */
.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 16px 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

header .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  text-align: center;
}

.logo {
  width: 200px;
  height: auto;
  padding: 4px;
}

header h1 {
  font-size: 1.4rem;
  margin: 0;
  text-align: center;
}

/* Navigation */
nav {
  padding-bottom: 8px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

nav ul li a {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

nav ul li a:hover {
  background-color: rgba(252, 163, 17, 0.1);
}

nav ul li a.active {
  background-color: var(--secondary-color);
  color: #ffffff;
}

/* ================================
   Bannières / Hero
   ================================ */

#home-banner,
#parcours-banner,
#vision-banner,
#engagement-banner {
  min-height: 80vh;
  margin-top: 110px; /* header fixe */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.banner-gradient {
  background: linear-gradient(135deg, #0a1023 0%, #14213D 40%, #1F3C88 100%);
}

.overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-color);
  z-index: 1;
}

.banner-content,
#parcours-content,
#vision-content,
#engagement-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  background: #ffffff;
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* Titre animé */
.animated-title {
  font-size: 2rem;
  margin-bottom: 8px;
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sous-titres */
.banner-content h3,
#parcours-content h3,
#vision-content h3,
#engagement-content h3 {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--primary-soft);
  margin-bottom: 16px;
}

/* ================================
   Hero Accueil
   ================================ */

.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 32px;
  align-items: center;
}

.col-text  { text-align: left; }
.col-image { text-align: center; }

/* Fix marge au-dessus du premier titre (H2) */
#home-banner .col-text .animated-title {
  margin-top: 0;
}

/* Fix portrait (pas d’étirement) */
.hero-portrait {
  width: 100%;
  max-width: 360px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Citation */
.quote {
  font-style: italic;
  border-left: 3px solid var(--secondary-color);
  padding-left: 12px;
  margin-top: 12px;
}

/* ================================
   Section Présentation (Accueil)
   ================================ */

#presentation {
  padding: 40px 0 50px 0;
}

/* Fix centrage du titre “Trois dimensions…” */
#presentation h3 {
  text-align: center;
  margin-bottom: 24px;
}

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.home-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.home-card h4 {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--primary-soft);
  margin-top: 0;
}

/* ================================
   Listes
   ================================ */

.home-list,
.vision-list,
.engagement-list {
  margin-left: 20px;
  padding-left: 0;
}

.home-list li,
.vision-list li,
.engagement-list li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* ================================
   Portrait superposé (page Parcours)
   ================================ */

/* Ancre le portrait dans le bloc blanc (sinon il "réduit" la zone de texte) */
#parcours-content {
  position: relative;
}

#portrait {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 3;
  width: 118px;
  height: 118px;
  margin: 0;
  pointer-events: none;
}

#portrait img {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

/* Évite que les titres passent sous le portrait */
#parcours-content .animated-title,
#parcours-content h3 {
  padding-right: 150px;
}

/* ================================
   Boutons / CTA
   ================================ */

.button {
  display: inline-block;
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 10px 24px;
  font-weight: 600;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.button:hover {
  background-color: var(--primary-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(20,33,61,0.25);
}

.cta-center {
  text-align: center;
  margin-top: 16px;
}

/* ================================
   Footer
   ================================ */

footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  text-align: center;
  padding: 14px 10px;
  font-size: 0.85rem;
}

/* ================================
   Responsive
   ================================ */

@media (max-width: 960px) {
  .two-columns {
    grid-template-columns: 1fr;
  }

  .col-image {
    order: -1;
  }

  header h1 {
    font-size: 1.2rem;
  }

  .logo {
    width: 160px;
  }
}

/* Mobile : le portrait repasse dans le flux, centré */
@media (max-width: 700px) {
  #portrait {
    position: static;
    width: auto;
    height: auto;
    pointer-events: auto;
    text-align: center;
    margin: 10px 0 18px 0;
  }

  #portrait img {
    width: 92px;
    height: 92px;
  }

  #parcours-content .animated-title,
  #parcours-content h3 {
    padding-right: 0;
  }
}

@media (max-width: 540px) {
  .logo {
    width: 120px;
  }

  header h1 {
    font-size: 1rem;
  }

  .banner-content,
  #parcours-content,
  #vision-content,
  #engagement-content {
    padding: 20px;
  }

  #home-banner,
  #parcours-banner,
  #vision-banner,
  #engagement-banner {
    min-height: 70vh;
  }

  .animated-title {
    font-size: 1.5rem;
  }
}
