/* ==========================================================================
   Hero Sections
   ========================================================================== */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background-color: var(--color-primary-dark);
  color: var(--color-surface);
  overflow: hidden;
  text-align: center;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(47, 150, 55, 0.7); /* Overlay vert semi-transparent per specs */
  z-index: 1;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  color: var(--color-surface);
  margin-bottom: var(--spacing-md);
}

.hero-subtitle {
  font-family: var(--font-family-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: var(--font-weight-regular);
  margin-bottom: var(--spacing-xl);
  color: var(--color-surface);
  opacity: 0.95;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: center;
}

/* Secondary Hero (Inner Pages) */
.hero-secondary {
  min-height: 400px; /* Force 400px per spec */
  align-items: center;
}
.hero-secondary-short {
  min-height: 350px;
}
.hero-secondary .hero-title {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  margin-top: var(--spacing-sm);
}
.breadcrumb a {
  color: rgba(255,255,255,0.8);
  text-decoration: underline;
}

/* ==========================================================================
   Features / Stats Section
   ========================================================================== */
.stats-section {
  background-color: var(--color-background-light); /* Gris très clair */
  padding: var(--spacing-xxl) 0;
}

.stats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-xl);
}

.stat-item {
  text-align: center;
  flex: 1 1 180px;
}

.stat-number {
  font-family: var(--font-family-heading);
  font-size: 3rem;
  font-weight: var(--font-weight-black);
  color: var(--color-accent); /* Jaune pour les chiffres */
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  color: var(--color-text-muted); /* Gris en dessous */
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

/* ==========================================================================
   Cards Container Pattern
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
}

@media (min-width: 768px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(4, 1fr); } /* 4 columns for mission cards on desktop */
}

/* Base Card (Programmes style) */
.card {
  background-color: var(--color-surface);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid rgba(0,0,0,0.05);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  display: block;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
  color: var(--color-primary-dark);
}

.card-text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--spacing-lg);
  flex-grow: 1;
}

.card-action {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.95rem;
}

/* ==========================================================================
   Two Column Layouts (Text + Image)
   ========================================================================== */
.split-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
  align-items: center;
}

@media (min-width: 992px) {
  .split-content {
    grid-template-columns: 1.2fr 1fr;
  }
}

.split-content-even {
  grid-template-columns: 1fr;
}
@media (min-width: 992px) {
  .split-content-even {
    grid-template-columns: 1fr 1fr;
  }
}

.split-image-wrap {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.split-image {
  width: 100%;
  display: block;
  object-fit: cover;
}

.badge {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-primary-dark);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  margin-bottom: var(--spacing-md);
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Photo Gallery Grid
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
}
.gallery-item {
  position: relative;
  aspect-ratio: 1/1; /* Format carré 400x400 required */
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(47, 150, 55, 0.85); /* Overlay vert spec */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
  padding: var(--spacing-md);
  text-align: center;
  font-weight: var(--font-weight-bold);
}
.gallery-item:hover img {
  transform: scale(1.05); /* Zoom léger */
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* ==========================================================================
   Testimonial Slider Structure
   ========================================================================== */
.testimonial-block {
  background-color: var(--color-background-light);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-md);
  text-align: center;
  position: relative;
}

.quote-icon {
  font-size: 3rem;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--spacing-sm);
  opacity: 0.2;
}

.quote-text {
  font-family: var(--font-family-heading);
  font-size: 1.25rem;
  font-weight: var(--font-weight-regular);
  font-style: italic;
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-main);
}

.quote-author {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-dark);
}

.quote-role {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Partner Logos Row
   ========================================================================== */
.partner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xl);
}

.partner-logo-img {
  max-width: 140px;
  max-height: 60px;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all var(--transition-fast);
}
.partner-logo-img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-dark);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #DDDDDD;
  background-color: #FAFAFA;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family-sans);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  background-color: white;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 150, 55, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ==========================================================================
   FAQ Accordion Base
   ========================================================================== */
.faq-item {
  border-bottom: 1px solid #EAEAEA;
  padding: var(--spacing-md) 0;
}
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  text-align: left;
  font-weight: var(--font-weight-bold);
  font-size: 1.125rem;
  color: var(--color-primary-dark);
  cursor: pointer;
  padding: 0.5rem 0;
}
.faq-answer {
  padding-top: var(--spacing-sm);
  color: var(--color-text-main);
  display: none; /* simple toggle behavior structure */
}

/* ==========================================================================
   Interactive Partner Animations (Cards)
   ========================================================================== */
.partner-anim-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0 0.5rem;
  margin-top: auto;
}

.partner-anim-icon {
  font-size: 1.8rem;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
  display: inline-block;
}

/* Base Hover */
.partner-anim-icon:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* 1. Pulse for Institutions */
.anim-pulse:hover {
  transform: scale(1.3);
}

/* 2. Spin for ONGs */
.anim-spin:hover {
  transform: scale(1.2) rotate(15deg);
}

/* 3. Bounce for Entreprises */
.anim-bounce:hover {
  transform: translateY(-8px) scale(1.15);
}

/* 4. Shake for Communautés */
@keyframes tilt-shake {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}
.anim-shake:hover {
  animation: tilt-shake 0.4s ease-in-out;
  transform: scale(1.2);
  filter: grayscale(0%);
  opacity: 1;
}

/* ==========================================================================
   Parallax Testimonial Background
   ========================================================================== */
.parallax-testimonial-section {
  position: relative;
  background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('../images/accueil/parallax-bg.jpg');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: white;
  padding: 6rem 1rem;
}

.parallax-testimonial-section .testimonial-block {
  background: transparent;
  box-shadow: none;
  border: none;
  max-width: 800px;
  margin: 0 auto;
}

.parallax-testimonial-section .quote-text {
  color: white;
  font-size: 1.8rem;
  line-height: 1.4;
  margin-bottom: 2rem;
}

.parallax-testimonial-section .quote-author {
  color: white;
  font-size: 1.2rem;
}

.parallax-testimonial-section .quote-role {
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Téléchargements & Rapports (Minimaliste)
   ========================================================================== */
.download-list {
  max-width: 700px;
  margin: 0 auto;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  transition: padding-left 0.3s ease, color 0.3s ease;
  color: var(--color-text-main);
  text-decoration: none;
}

.download-item:hover {
  padding-left: 0.5rem;
  color: var(--color-primary);
}

.download-item-title {
  font-size: 1.1rem;
  font-weight: bold;
}

.download-item-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.download-item-icon {
  font-size: 1.25rem;
  color: var(--color-primary);
  opacity: 0.8;
  transition: transform 0.3s ease;
}

.download-item:hover .download-item-icon {
  transform: translateY(3px);
  opacity: 1;
}

/* ==========================================================================
   Albums Photos & Lightbox
   ========================================================================== */
.gallery-albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-md);
}

.album-card {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.album-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.album-card:hover img {
  transform: scale(1.08);
}
.album-card:hover {
  box-shadow: var(--shadow-md);
}

.album-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--spacing-lg);
  color: white;
  transition: background 0.3s ease;
}

.album-title {
  color: var(--color-accent); /* Jaune or */
  font-size: 1.15rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.album-cta {
  font-size: 0.95rem;
  color: var(--color-primary-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
}

/* Lightbox Styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  border-radius: 4px;
}

.lightbox-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  pointer-events: none;
}

.lightbox-btn {
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  pointer-events: all;
  transition: background 0.3s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-btn:hover {
  background: var(--color-primary);
  transform: scale(1.1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover {
  opacity: 1;
}

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0,0,0,0.7);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-size: 1.1rem;
  text-align: center;
  backdrop-filter: blur(5px);
}
@media (max-width: 768px) {
  .lightbox-controls { padding: 0 0.5rem; }
  .lightbox-btn { width: 45px; height: 45px; font-size: 1.5rem; }
  .lightbox-close { top: 10px; right: 10px; font-size: 2.5rem; }
}

/* ==========================================================================
   Article Modal (Reading view)
   ========================================================================== */
.article-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(5px);
}

.article-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.article-modal-container {
  background: white;
  width: 90%;
  max-width: 850px;
  max-height: 85vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  transform: translateY(25px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.article-modal.active .article-modal-container {
  transform: translateY(0) scale(1);
}

.article-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdfdfd;
}

.article-modal-title {
  font-family: var(--font-family-heading);
  font-size: 1.5rem;
  color: var(--color-primary-dark);
  font-weight: bold;
  margin: 0;
  line-height: 1.3;
}

.article-modal-close {
  background: rgba(0,0,0,0.05);
  border: none;
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.article-modal-close:hover {
  background: var(--color-primary);
  color: white;
  transform: rotate(90deg);
}

.article-modal-body {
  padding: 2.5rem;
  overflow-y: auto;
  color: var(--color-text-main);
  line-height: 1.8;
  font-size: 1.05rem;
  background: white;
}

.article-modal-cover {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.article-content h4 {
  color: var(--color-primary-dark);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.35rem;
  font-family: var(--font-family-heading);
  border-left: 4px solid var(--color-accent);
  padding-left: 1rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Animations that trigger when modal opens */
.article-modal.active .article-modal-cover {
  animation: slideFadeIn 0.6s ease forwards 0.1s;
  opacity: 0;
}
.article-modal.active .article-content > * {
  animation: slideFadeIn 0.6s ease forwards 0.2s;
  opacity: 0;
}

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

@media (max-width: 768px) {
  .article-modal-container {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .article-modal-header, .article-modal-body {
    padding: 1.25rem;
  }
  .article-modal-title { font-size: 1.25rem; }
  .article-modal-cover { height: 200px; }
}
