:root {
  --bg: #1C3F50;
  --text: #EDDFCF;
  --muted: #D8C7B5;
  --border: rgba(237,223,207,0.25);
  --shadow: rgba(237,223,207,0.15);
  --gold: rgba(181,155,101,0.4);
}

/* RESET + STRUCTURE */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { scroll-behavior: smooth; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Century Schoolbook", Georgia, "Times New Roman", serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 80px;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

/* HERO */
.hero {
  padding-top: 60px; /* corrige l’espacement sous le header fixe */
  text-align: center;
  max-width: 800px;
  margin: 0 auto 20px;
}

.logo-center img {
  max-width: 130px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.hero h1 {
  font-size: 30px;
  color: var(--text); 
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.hero h2 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

.hero p {
  font-size: 15px;
  color: var(--text);
  opacity: 0.9;
  line-height: 1.5;
}

/* BLOCS */
.section {
  flex: 1;
  padding: 15px 20px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px; /* un peu plus d’air entre les blocs */
}

/* Bloc principal */
.card {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 18px var(--shadow);
  transition: all 0.4s ease;
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 18px rgba(181,155,101,0.45);
}

/* Disposition image / texte */
.card.left-image {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 18px;
  align-items: flex-start;
}

.card-image-and-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-image-and-btn img {
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--gold);
  margin-bottom: 12px;
  max-height: 200px;
  object-fit: cover;
}

.card-btn {
  padding: 7px 14px;
  font-size: 14px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: rgba(181,155,101,0.1);
  color: var(--text);
  text-decoration: none;
  transition: 0.25s;
}

.card-btn:hover {
  background: rgba(181,155,101,0.25);
  box-shadow: 0 0 6px rgba(181,155,101,0.45);
  transform: translateY(-1px);
}

/* Contenu texte et bouton */
.card-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.card-content h3 {
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--text);
}

.card-content p {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.5;
  text-align: justify;
}

.card-content ul {
  margin: 0 0 18px 0;
  font-size: 15px;
  text-align: left;           /* texte aligné à gauche */
  padding-left: 22px;         /* garde une marge élégante */
  line-height: 1.45;
  text-align: left;
  list-style-position: outside;
}

/* Bouton sous  l’image */
.card-cta {
  text-align: center;
  margin: 10px 0 14px 0;
}

.card-cta .btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: rgba(181,155,101,0.12);
  color: var(--text);
  text-decoration: none;
  transition: 0.25s;
}

.card-cta .btn:hover {
  background: rgba(181,155,101,0.25);
  box-shadow: 0 0 8px rgba(181,155,101,0.45);
}

/* ANIMATIONS */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 0.8s ease forwards;
}

/* --- RESPONSIVE CONSOLIDÉ ET STABILISÉ --- */
@media (max-width: 980px) {

  /* Cartes en une seule colonne et espacement adouci */
  .cards-container {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  /* Réorganisation du contenu interne des cartes */
  .card.left-image {
    grid-template-columns: 1fr;
  }

  /* Bouton repositionné pour garder une belle hiérarchie */
  .btn-right {
    text-align: center;
    margin-right: 0;
  }

  /* Bloc hero (logo + titres + sous-titre) */
  .hero {
    padding-top: 80px; /* marge suffisante sous la barre */
    margin-bottom: 12px;
    text-align: center;
  }

  /* Ajustement typographique des titres */
  .hero h1 {
    font-size: 24px;
    margin-bottom: 4px;
  }

  .hero h2 {
    font-size: 16px;
    margin-bottom: 6px;
  }

  /* Logo recentré et redimensionné */
  .logo-center img {
    max-width: 100px;
    margin-bottom: 10px;
  }

  /* Contenu des cartes : lisibilité améliorée */
  .card-content h3 {
    font-size: 17px;
  }

  .card-content p {
    font-size: 15px;
    line-height: 1.4;
  }

  /* Alignement des listes à gauche */
  .card-content ul {
    text-align: left;
    padding-left: 18px;
    list-style-position: outside;
  }

  /* Libère le scroll et la zone de rebond */
  html, body {
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Spécifique Safari iOS : ajuste la marge haute en fonction de la safe area --- */
@supports (-webkit-touch-callout: none) {
  :root {
    --safe-top: env(safe-area-inset-top, 20px);
  }

  .hero {
    position: relative;
    top: calc(80px + var(--safe-top)); /* pousse tout le bloc vers le bas */
    padding-top: 60px !important;
    margin-top: 0;
    z-index: 1;
  }

  /* assure une transition fluide vers les blocs suivants */
  .section {
    margin-top: 60px !important;
  }
}
