/* ====================================================
   Site mémorial — Papa Bruno
   Palette : cream #f8f5ef · dark #1a1a2e · gold #c9a040 · text #2c2c2c
   ==================================================== */

:root {
  --cream:      #f8f5ef;
  --cream-dark: #ede8de;
  --dark:       #1a1a2e;
  --dark2:      #0f0f1a;
  --gold:       #c9a040;
  --gold-dark:  #8b6914;
  --text:       #2c2c2c;
  --text-muted: #6b6b6b;
  --text-light: #f0ebe0;
  --border:     #d4b896;
  --radius:     8px;
  --transition: .3s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); }

/* ====== Typographie ====== */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.25;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: .5rem;
}
.section-subtitle {
  color: var(--gold);
  font-family: 'Lato', sans-serif;
  font-size: .9rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.divider {
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 1rem 0 2.5rem;
}

/* ====== Navbar ====== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}
.navbar.scrolled {
  background: rgba(15, 15, 26, .97);
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
  padding: .75rem 2rem;
}
.navbar-brand {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.1rem;
  opacity: .9;
}
.navbar-nav {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}
.navbar-nav a {
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.navbar-nav a:hover { color: var(--gold); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: #fff;
  transition: var(--transition);
  display: block;
}

/* ====== Hero ====== */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(.45);
  transform: scale(1.04);
  transition: transform 8s ease;
}
.hero-bg.loaded { transform: scale(1); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,10,20,.3) 0%, rgba(10,10,20,.7) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem 1.5rem;
  max-width: 720px;
}
.hero-eyebrow {
  color: var(--gold);
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-name {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  color: #fff;
  font-family: 'Playfair Display', serif;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.hero-dates {
  color: var(--gold);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  margin-bottom: 1.5rem;
}
.hero-quote {
  color: rgba(255,255,255,.75);
  font-size: .95rem;
  font-style: italic;
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}
.hero-scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255,255,255,.5);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  gap: .5rem;
  cursor: pointer;
  transition: color var(--transition);
}
.hero-scroll:hover { color: var(--gold); }
.hero-scroll svg { animation: bounce 2s infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* ====== Sections génériques ====== */
.section { padding: 5rem 1.5rem; }
.section-dark {
  background: var(--dark);
  color: var(--text-light);
}
.section-dark .section-title { color: var(--text-light); }
.section-dark .divider { background: var(--gold); }
.container { max-width: 1100px; margin: 0 auto; }

/* ====== Avis de décès ====== */
.avis-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.avis-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 2rem;
}
.avis-text strong { color: var(--dark); }
.avis-verse {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.5rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
  background: var(--cream-dark);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ====== Timeline ====== */
.timeline { position: relative; padding-left: 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--gold);
  transform: translateX(-50%);
}
.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + 2.5rem);
  margin-bottom: 3rem;
  position: relative;
}
.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + 2.5rem);
}
.timeline-dot {
  position: absolute;
  left: 50%;
  top: .4rem;
  width: 14px; height: 14px;
  background: var(--gold);
  border: 3px solid var(--dark);
  border-radius: 50%;
  transform: translateX(-50%);
}
.timeline-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,160,64,.25);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  max-width: 380px;
  width: 100%;
}
.timeline-year {
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: .25rem;
}
.timeline-card h3 { font-size: 1rem; color: var(--text-light); margin-bottom: .3rem; }
.timeline-card p  { font-size: .9rem; color: rgba(240,235,224,.7); }

/* ====== Famille ====== */
.famille-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.famille-card {
  background: var(--cream-dark);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
}
.famille-card .icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: block;
}
.famille-card strong { display: block; font-size: 2rem; font-family: 'Playfair Display', serif; color: var(--dark); }
.famille-card span   { font-size: .85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.famille-card-flag { justify-content: center; }
.flag-pair {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
}
.flag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}
.flag-item svg {
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.flag-item small {
  font-size: .72rem;
  color: var(--text-muted);
  letter-spacing: .04em;
}
.flag-divider {
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: 700;
  margin-top: -1rem;
}
.famille-card strong { font-size: 1.6rem; }

.famille-note {
  margin-top: 2rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
}

/* ====== Galerie ====== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  cursor: pointer;
  background: rgba(255,255,255,.05);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,20,.4);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay svg { color: #fff; width: 2rem; height: 2rem; }
.gallery-empty {
  text-align: center;
  padding: 3rem;
  color: rgba(240,235,224,.4);
  font-style: italic;
}

/* ====== Lightbox ====== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  opacity: .7;
  transition: opacity var(--transition);
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: .6;
  transition: opacity var(--transition);
  padding: .5rem 1rem;
}
.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ====== Veillée & RSVP ====== */
.event-card {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 3rem;
}
.event-header { display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.event-icon { font-size: 2.5rem; flex-shrink: 0; }
.event-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--dark);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .75rem;
  border-radius: 2px;
  margin-bottom: .5rem;
}
.event-title { font-size: 1.4rem; margin-bottom: .25rem; }
.event-details { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.event-details li { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.event-details svg { color: var(--gold); flex-shrink: 0; }

.rsvp-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.rsvp-title { font-size: 1.1rem; margin-bottom: 1.5rem; font-family: 'Playfair Display', serif; }

/* ====== Formulaires ====== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,160,64,.15);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.hp-field { display: none !important; }  /* honeypot caché */

.btn-primary {
  background: var(--gold);
  color: var(--dark);
  font-weight: 700;
  font-size: .95rem;
  border: none;
  border-radius: var(--radius);
  padding: .8rem 2rem;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background var(--transition), transform .1s;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.btn-primary:hover  { background: var(--gold-dark); color: #fff; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.form-notice {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .5rem;
  font-style: italic;
}
.form-message {
  padding: .85rem 1.2rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-top: 1rem;
  display: none;
}
.form-message.success { background: #d1e7dd; color: #0f5132; border: 1px solid #a3cfbb; display: block; }
.form-message.error   { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; display: block; }

/* ====== Condoléances ====== */
.condoleances-list {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.condoleance-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(201,160,64,.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.condoleance-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
  flex-wrap: wrap;
  gap: .25rem;
}
.condoleance-nom { font-weight: 700; color: var(--gold); font-size: .95rem; }
.condoleance-date { font-size: .78rem; color: rgba(240,235,224,.45); }
.condoleance-msg { font-size: .92rem; line-height: 1.65; color: rgba(240,235,224,.8); }
.condoleances-empty { text-align: center; color: rgba(240,235,224,.4); font-style: italic; padding: 2rem 0; }

.condoleance-form-section { border-top: 1px solid rgba(201,160,64,.2); padding-top: 2.5rem; margin-top: 2rem; }
.condoleance-form-section .form-group label { color: var(--text-light); }
.condoleance-form-section input,
.condoleance-form-section textarea {
  background: rgba(255,255,255,.07);
  border-color: rgba(201,160,64,.3);
  color: var(--text-light);
}
.condoleance-form-section input::placeholder,
.condoleance-form-section textarea::placeholder { color: rgba(240,235,224,.35); }

/* ====== Dons ====== */
.dons-intro { max-width: 620px; margin-bottom: 2.5rem; color: var(--text-muted); }
.dons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.don-card {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.don-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); transform: translateY(-2px); }
.don-logo {
  font-size: 1.75rem;
  margin-bottom: .25rem;
}
.don-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--dark);
}
.don-info {
  font-size: .88rem;
  color: var(--text-muted);
  word-break: break-all;
}
.don-nom { font-size: .82rem; color: var(--text-muted); font-style: italic; }
.btn-copy {
  margin-top: auto;
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  border-radius: var(--radius);
  padding: .4rem .85rem;
  font-size: .8rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  align-self: flex-start;
}
.btn-copy:hover { background: var(--gold); color: var(--dark); }
.btn-copy.copied { background: #d1e7dd; border-color: #a3cfbb; color: #0f5132; }

.don-link {
  display: inline-block;
  margin-top: auto;
  background: var(--gold);
  color: var(--dark);
  font-size: .82rem;
  font-weight: 700;
  padding: .4rem .85rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.don-link:hover { background: var(--gold-dark); color: #fff; }

/* ====== Carte Wave avec QR ====== */
.don-card-wave { border-color: #1DC8EE; }
.wave-qr-box {
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  margin: .75rem auto 0;
}
.wave-qr-box canvas, .wave-qr-box img { display: block !important; }
.wave-qr-label {
  font-size: .75rem;
  color: #1DC8EE;
  text-align: center;
  margin: .35rem 0 .5rem;
  letter-spacing: .04em;
  font-weight: 700;
  text-transform: uppercase;
}

/* ====== Quill éditeur (thème sombre condoléances) ====== */
.quill-dark {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(201,160,64,.3);
  border-radius: 0 0 var(--radius) var(--radius);
  color: var(--text-light);
  min-height: 130px;
}
.quill-dark .ql-editor { min-height: 120px; font-family: 'Lato', sans-serif; font-size: .95rem; line-height: 1.7; }
.quill-dark .ql-editor.ql-blank::before { color: rgba(240,235,224,.35); font-style: italic; }

/* Toolbar Quill en dark */
.condoleance-form-section .ql-toolbar.ql-snow {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,160,64,.3);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.condoleance-form-section .ql-toolbar .ql-stroke { stroke: rgba(240,235,224,.7); }
.condoleance-form-section .ql-toolbar .ql-fill   { fill:   rgba(240,235,224,.7); }
.condoleance-form-section .ql-toolbar button:hover .ql-stroke { stroke: var(--gold); }
.condoleance-form-section .ql-toolbar button:hover .ql-fill   { fill:   var(--gold); }
.condoleance-form-section .ql-toolbar button.ql-active .ql-stroke { stroke: var(--gold); }
.condoleance-form-section .ql-toolbar button.ql-active .ql-fill   { fill:   var(--gold); }

/* ====== Upload photos condoléances ====== */
.photo-upload-zone {
  position: relative;
  border: 2px dashed rgba(201,160,64,.35);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.photo-upload-zone:hover,
.photo-upload-zone.drag-over { border-color: var(--gold); background: rgba(201,160,64,.07); }
.photo-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.photo-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: rgba(240,235,224,.5);
  font-size: .88rem;
  pointer-events: none;
}
.photo-drop-label svg { color: var(--gold); opacity: .7; }
.photo-drop-label small { font-size: .75rem; opacity: .6; }

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
  justify-content: center;
}
.photo-preview-item {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(201,160,64,.4);
}
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-remove {
  position: absolute;
  top: 2px; right: 2px;
  background: rgba(0,0,0,.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  cursor: pointer;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ====== Affichage photos dans les cartes condoléances ====== */
.condoleance-photos {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}
.condoleance-photo {
  width: 72px; height: 72px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(201,160,64,.25);
}
.condoleance-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.condoleance-photo:hover img { transform: scale(1.08); }

/* Contenu riche condoléances */
.condoleance-msg p  { margin-bottom: .4rem; }
.condoleance-msg ul,
.condoleance-msg ol { margin-left: 1.2rem; margin-bottom: .4rem; }
.condoleance-msg strong { color: var(--text-light); }

/* ====== Footer ====== */
.footer {
  background: var(--dark2);
  color: rgba(240,235,224,.5);
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: .85rem;
}
.footer-name { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--gold); margin-bottom: .4rem; }
.footer-dates { margin-bottom: 1rem; }
.footer-copy { font-size: .78rem; opacity: .5; margin-top: 1rem; }

/* ====== Animations au scroll ====== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .navbar-nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: rgba(15,15,26,.97); padding: 1.5rem 2rem; gap: 1.25rem; }
  .navbar-nav.open { display: flex; }
  .nav-toggle { display: flex; }

  .timeline::before { left: 1.5rem; }
  .timeline-item { justify-content: flex-start; padding-right: 0; padding-left: 4rem; }
  .timeline-item:nth-child(even) { justify-content: flex-start; padding-left: 4rem; }
  .timeline-dot { left: 1.5rem; }
  .timeline-card { max-width: 100%; }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }

  .event-header { flex-direction: column; gap: .75rem; }
  .dons-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .section { padding: 3.5rem 1rem; }
  .hero-content { padding: 2rem 1rem; }
  .dons-grid { grid-template-columns: 1fr; }
  .famille-grid { grid-template-columns: 1fr 1fr; }
  .event-card { padding: 1.5rem; }
}
