/* ============================================================
   MOVE CORSICA — Feuille de style principale
   Palette officielle move.corsica — fond #fff, accent #83359a
   Mobile-first, CSS Grid pour la grille projets
   ============================================================ */

/* ---- Reset & base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-main:       #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #faf8fc;
  --bg-overlay:    #f3eef6;
  --accent:        #83359a;
  --accent-hover:  #682579;
  --text-primary:  #222222;
  --text-brand:    #31343c;
  --text-muted:    #666666;
  --border:        #eeeeee;
  --progress-bg:   #e8dced;
  --radius:        8px;
  --shadow:        0 4px 20px rgba(131,53,154,0.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); }

/* ============================================================
   HEADER — position fixed, fond blanc
   ============================================================ */
.site-header {
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(60,20,80,0.04);
}

.header-logo img {
  height: 38px;
  width: auto;
  display: block;
}

.header-logo span {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-brand);
  letter-spacing: 0.02em;
}

/* Groupe nav + contact (desktop : inline) */
.header-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav a {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-brand);
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.header-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Burger (masqué sur desktop) */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 101;
}
.burger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-brand);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
/* Animation → croix */
.site-header.nav-open .burger-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .burger-btn span:nth-child(2) { opacity: 0; }
.site-header.nav-open .burger-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header-contact a {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bg-main);
  background: var(--accent);
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 1.3rem;
  transition: background 0.2s;
  display: inline-block;
}
.header-contact a:hover {
  background: var(--accent-hover);
}

/* ============================================================
   SLIDER — pleine largeur, 490px, transition 400ms ease
   ============================================================ */
.slider-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 70px;
  max-height: 490px;
}

.slider-track {
  display: flex;
  width: 100%;
  height: 490px;
  transition: transform 0.4s ease;
}

.slide {
  min-width: 100%;
  width: 100%;
  flex-shrink: 0;
  height: 490px;
  overflow: hidden;
}

.slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

/* Flèches prev/next — cercles violets 40px */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(131,53,154,0.5);
  border: none;
  color: var(--bg-main);
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}
.slider-btn:hover { background: rgba(131,53,154,0.8); }
.slider-btn.prev  { left: 1rem; }
.slider-btn.next  { right: 1rem; }

/* Dots de pagination */
.slider-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ============================================================
   SECTION PROJETS
   ============================================================ */
.projects-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-brand);
  margin-bottom: 2.5rem;
  text-align: center;
}

/* Grille responsive */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .projects-grid { grid-template-columns: repeat(4, 1fr); }
  .slider-section { max-height: 735px; }
  .slider-track   { height: 735px; }
  .slide          { height: 735px; }
}

/* ============================================================
   CARTE PROJET
   ============================================================ */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg-overlay);
}


.card-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-overlay) 0%, #ddd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
}

.card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-brand);
  line-height: 1.4;
  text-align: center;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.card-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-backers-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-backers-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-brand);
}

.card-backers-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-raised-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-raised {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

/* Message d'erreur chargement */
.load-error {
  color: var(--accent);
  padding: 2rem;
}

/* ============================================================
   MODAL DÉTAIL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem 1rem;
  align-items: flex-start;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(131,53,154,0.18);
  animation: modal-in 0.25s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.45);
  border: none;
  color: var(--bg-main);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--accent); }

.modal-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Wrapper 16/9 pour iframe YouTube */
.modal-video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.modal-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.modal-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--bg-overlay) 0%, #ddd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 4rem;
}

/* Bande stats : contributeurs + collectés */
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: #019aff;
  padding: 1.25rem 1.75rem;
  text-align: center;
}

.modal-stat-item strong {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bg-main);
}
.modal-stat-item span {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-brand);
  line-height: 1.3;
  text-align: center;
}

.modal-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.modal-description p   { margin-bottom: 0.75rem; }
.modal-description p:last-child { margin-bottom: 0; }

/* Images insérées dans fullDescription */
.description-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  margin: 0.75rem 0;
}

figure:has(.description-img) {
  margin: 0.75rem 0;
}

.modal-description > figure:first-child {
  margin-left: -1.75rem;
  margin-right: -1.75rem;
}
.modal-description > figure:first-child > .description-img {
  width: 100%;
  border-radius: 0;
  margin: 0;
}

figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.3rem;
  font-style: italic;
}

.modal-description .titre-rouge {
  color: red;
  text-decoration: underline;
  font-weight: bold;
}

.modal-description .centré {
  text-align: center;
}

/* Pages sans slider : compense le header fixe */
.page-main { margin-top: 70px; }

/* ============================================================
   PAGE MÉDIAS
   ============================================================ */
.medias-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 820px;
  margin: 0 auto;
}

.media-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.media-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem 0.7rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  text-align: center;
}

.media-source {
  font-size: 1.43rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.media-date {
  font-size: 1.28rem;
  color: var(--text-muted);
}

.media-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.media-headline {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-brand);
  line-height: 1.4;
  margin: 0;
}

.media-caption {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.media-img {
  width: 100%;
  height: auto;
  display: block;
}

.media-video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.media-video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Partenaires */
.partners-section {
  max-width: 820px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.partners-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}

.partners-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: flex-start;
}

.partners-grid img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: grayscale(40%);
  opacity: 0.8;
  transition: filter 0.2s, opacity 0.2s;
}

.partners-grid img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* ============================================================
   LIGHTBOX SLIDER
   ============================================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4rem;
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE — ajustements header sur mobile
   ============================================================ */
@media (max-width: 600px) {
  .site-header { padding: 12px 16px; }

  /* Masquer le menu inline, afficher le burger */
  .header-menu { display: none; }
  .burger-btn  { display: flex; }

  /* Dropdown menu mobile */
  .site-header.nav-open .header-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-main);
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    z-index: 99;
    padding: 0.5rem 0;
  }
  .site-header.nav-open .header-nav a {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-brand);
  }
  .site-header.nav-open .header-contact {
    padding: 0.85rem 1.5rem;
  }
  .site-header.nav-open .header-contact a {
    display: block;
    text-align: center;
    font-size: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 1.3rem;
  }

  .section-title  { text-align: center; }

  /* Slider : l'image dicte sa propre hauteur, rien n'est rogné */
  .slider-section { max-height: none; }
  .slider-track   { height: auto; }
  .slide          { height: auto; }
  .slide img      { height: auto; object-fit: initial; }
}
