/* ============================================================
   Diamalaye
   Système de design
   ============================================================ */

:root {
  --ink: #12241E;
  --emerald: #0F5C46;
  --emerald-deep: #0A3E30;
  --sand: #EDE6D6;
  --sand-light: #FAF8F3;
  --gold: #A9832E;
  --gold-soft: #C9A55C;
  --line: rgba(18, 36, 30, 0.14);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
  --font-caption: "Work Sans", sans-serif;

  --max-width: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--sand-light);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--emerald-deep);
  margin: 0 0 0.5em;
  line-height: 1.15;
}

p { margin: 0 0 1em; }

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

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

/* ---------- Motif signature : étoile à 8 branches ---------- */

.star-bullet {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  flex-shrink: 0;
  background: var(--gold);
  clip-path: polygon(
    50% 0%, 61% 35%, 100% 35%, 69% 57%,
    82% 91%, 50% 70%, 18% 91%, 31% 57%,
    0% 35%, 39% 35%
  );
}

.wave-divider {
  width: 100%;
  height: 28px;
  overflow: hidden;
  color: var(--emerald);
}
.wave-divider svg { display: block; width: 100%; height: 100%; }

/* ---------- Header ---------- */

.site-header {
  background: var(--sand-light);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--emerald-deep);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text .eyebrow {
  font-family: var(--font-caption);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.brand-text .name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--emerald-deep);
}

.main-nav {
  display: flex;
  gap: 28px;
}

.main-nav a {
  font-family: var(--font-caption);
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
}
.main-nav a:hover { color: var(--emerald); text-decoration: none; }
.main-nav a.active { color: var(--emerald-deep); font-weight: 700; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--emerald-deep);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sand-light);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 12px 24px 24px;
    gap: 16px;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background-image:
    linear-gradient(100deg, rgba(11,61,48,0.94) 0%, rgba(11,61,48,0.82) 45%, rgba(11,61,48,0.55) 100%),
    url("images/quote-band.jpg");
  background-size: cover;
  background-position: center 65%;
  color: var(--sand-light);
  padding: 96px 0 88px;
  overflow: hidden;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero .eyebrow {
  font-family: var(--font-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold-soft);
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
}

.hero h1 {
  color: var(--sand-light);
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  margin-bottom: 22px;
}

.hero p.lede {
  font-size: 1.15rem;
  color: rgba(250, 248, 243, 0.86);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: var(--font-caption);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 13px 26px;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
}
.btn-primary:hover { background: var(--gold-soft); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--sand-light);
  border-color: rgba(250, 248, 243, 0.5);
}
.btn-outline:hover { border-color: var(--sand-light); text-decoration: none; }

/* ---------- Sections génériques ---------- */

section { padding: 76px 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head .eyebrow {
  display: flex;
  align-items: center;
  font-family: var(--font-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 14px;
}

.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

.section-head p { color: rgba(18, 36, 30, 0.72); }

/* ---------- Grille mission ---------- */

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

.mission-card {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 30px 28px;
}

.mission-card .star-bullet { margin-bottom: 14px; }

.mission-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.mission-card p {
  color: rgba(18, 36, 30, 0.75);
  font-size: 0.96rem;
  margin: 0;
}

/* ---------- Bandeau citation ---------- */

.quote-band {
  background: var(--sand);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quote-band blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  color: var(--emerald-deep);
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  font-style: italic;
}

.quote-band cite {
  display: block;
  margin-top: 18px;
  font-family: var(--font-caption);
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Actualités : liste de cartes ---------- */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 620px) {
  .news-item { grid-template-columns: 1fr; gap: 8px; }
}

.news-date {
  font-family: var(--font-caption);
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-top: 4px;
}

.news-item h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.news-item p { color: rgba(18, 36, 30, 0.75); margin-bottom: 0; }

.news-empty {
  padding: 40px 0;
  color: rgba(18, 36, 30, 0.55);
  font-style: italic;
}

/* ---------- À propos : membres / instances ---------- */

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.role-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px 26px;
  background: var(--sand-light);
}

.role-card h3 {
  font-size: 1.02rem;
  display: flex;
  align-items: center;
}

.role-card p {
  color: rgba(18, 36, 30, 0.72);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Formulaire de contact ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

@media (max-width: 800px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-info h3 {
  font-size: 1.05rem;
  margin-top: 28px;
}
.contact-info h3:first-child { margin-top: 0; }
.contact-info p { color: rgba(18, 36, 30, 0.75); }

form.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field label {
  display: block;
  font-family: var(--font-caption);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--emerald-deep);
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--sand-light);
  color: var(--ink);
}

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

.form-note {
  font-size: 0.85rem;
  color: rgba(18, 36, 30, 0.6);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(250, 248, 243, 0.75);
  padding: 52px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

.site-footer h4 {
  color: var(--sand-light);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-caption);
  margin-bottom: 14px;
}

.site-footer p, .site-footer a {
  color: rgba(250, 248, 243, 0.7);
  font-size: 0.92rem;
}
.site-footer a:hover { color: var(--gold-soft); }

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-bottom {
  border-top: 1px solid rgba(250, 248, 243, 0.14);
  padding-top: 22px;
  font-size: 0.8rem;
  color: rgba(250, 248, 243, 0.5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Page interne : bandeau titre ---------- */

.page-hero {
  background: var(--emerald-deep);
  color: var(--sand-light);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}
.page-hero .container { position: relative; z-index: 1; max-width: 760px; }
.page-hero .eyebrow {
  font-family: var(--font-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold-soft);
  font-weight: 600;
  margin-bottom: 14px;
}
.page-hero h1 { color: var(--sand-light); font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 12px; }
.page-hero p { color: rgba(250, 248, 243, 0.86); max-width: 60ch; margin: 0; }

/* ---------- Admin ---------- */

.admin-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.admin-card {
  background: var(--sand-light);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 30px;
  margin-bottom: 24px;
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.admin-list-item:last-child { border-bottom: none; }

.admin-list-item .meta { font-size: 0.85rem; color: rgba(18,36,30,0.6); }

.btn-small {
  font-family: var(--font-caption);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: none;
  cursor: pointer;
  color: var(--ink);
}
.btn-small:hover { background: var(--sand); }
.btn-small.danger { color: #9C3B2E; border-color: #9C3B2E33; }
.btn-small.danger:hover { background: #9C3B2E11; }

.admin-login {
  max-width: 380px;
  margin: 120px auto;
  text-align: center;
}

/* ============================================================
   Animations
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .mission-card,
  .role-card,
  .news-item,
  .section-head {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }
}

/* Animation d'apparition pour le hero */
.hero h1,
.hero .lede,
.hero .hero-actions {
  animation: fadeUp 0.8s ease-out forwards;
}
.hero .lede { animation-delay: 0.15s; }
.hero .hero-actions { animation-delay: 0.3s; }

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

/* Légère animation au survol des cartes */
.mission-card:hover,
.role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(18, 36, 30, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================
   Timeline historique
   ============================================================ */

.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 0;
}

/* Ligne verticale centrale */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%);
}

.tl-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 48px;
}

.tl-item:last-child {
  margin-bottom: 0;
}

/* Marqueur central (année + point) */
.tl-marker {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.tl-year {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--sand-light);
  padding: 2px 10px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid var(--line);
  margin-bottom: 6px;
}

.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--emerald);
  border: 3px solid var(--sand-light);
  box-shadow: 0 0 0 2px var(--emerald);
}

/* Carte de contenu */
.tl-card {
  width: calc(50% - 40px);
  background: var(--sand-light);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 24px;
  position: relative;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tl-card:hover {
  box-shadow: 0 6px 20px rgba(18, 36, 30, 0.08);
  transform: translateY(-2px);
}

/* Positionnement alterné */
.tl-left .tl-card {
  margin-right: auto;
}

.tl-right .tl-card {
  margin-left: auto;
}

/* Tag */
.tl-tag {
  display: inline-block;
  font-family: var(--font-caption);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(169, 131, 46, 0.08);
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}

.tl-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.tl-card p {
  font-size: 0.92rem;
  color: rgba(18, 36, 30, 0.75);
  margin: 0;
  line-height: 1.65;
}

/* Version mobile : tout en colonne */
@media (max-width: 700px) {
  .timeline::before {
    left: 24px;
  }

  .tl-item {
    flex-direction: column;
    padding-left: 52px;
  }

  .tl-marker {
    left: 24px;
    top: 0;
    transform: translateX(-50%);
  }

  .tl-card {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ============================================================
   CARTE INTERACTIVE (Leaflet)
   ============================================================ */
.interactive-map {
  width: 100%;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 32px;
  overflow: hidden;
}
.interactive-map .leaflet-container {
  font-family: var(--font-body);
}
.interactive-map .leaflet-popup-content-wrapper {
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(18,36,30,0.12);
}
.interactive-map .leaflet-popup-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}
.interactive-map .leaflet-popup-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 4px;
  color: var(--emerald-deep);
}
.interactive-map .leaflet-popup-content p {
  margin: 0;
  color: rgba(18,36,30,0.7);
}

/* ============================================================
   LECTEUR AUDIO
   ============================================================ */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.audio-player .ap-play-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--emerald);
  color: var(--sand-light);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.audio-player .ap-play-btn:hover {
  background: var(--emerald-deep);
}
.audio-player .ap-play-btn.playing {
  background: var(--gold);
}
.audio-player .ap-info {
  flex: 1;
  min-width: 0;
}
.audio-player .ap-title {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-player .ap-meta {
  font-size: 0.75rem;
  color: rgba(18,36,30,0.5);
}
.audio-player .ap-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 120px;
}
.audio-player .ap-range {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.audio-player .ap-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--emerald);
  border: 2px solid var(--sand-light);
  cursor: pointer;
}
.audio-player .ap-time {
  font-size: 0.75rem;
  color: rgba(18,36,30,0.55);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}
.audio-player .ap-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.audio-player .ap-volume input {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.audio-player .ap-volume input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
}

/* ============================================================
   RECHERCHE GLOBALE
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(18,36,30,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.search-modal {
  width: 100%;
  max-width: 600px;
  background: var(--sand-light);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(18,36,30,0.2);
  overflow: hidden;
}
.search-field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.search-field input {
  flex: 1;
  border: none;
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: transparent;
  outline: none;
  color: var(--ink);
}
.search-field input::placeholder {
  color: rgba(18,36,30,0.35);
}
.search-close-btn {
  background: none;
  border: none;
  padding: 16px 20px;
  font-size: 1.2rem;
  cursor: pointer;
  color: rgba(18,36,30,0.45);
  transition: color 0.15s;
}
.search-close-btn:hover {
  color: var(--ink);
}
.search-results {
  max-height: 400px;
  overflow-y: auto;
}
.search-result-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--line);
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover {
  background: var(--sand);
}
.search-result-item .sr-title {
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}
.search-result-item .sr-title strong {
  color: var(--emerald);
}
.search-result-item .sr-path {
  font-size: 0.78rem;
  color: rgba(18,36,30,0.4);
}
.search-no-results {
  padding: 24px 20px;
  text-align: center;
  color: rgba(18,36,30,0.45);
}
