:root {
  /* Palette inspirée de l'affiche */
  --navy: #1a3a6e;
  --navy-dark: #122a52;
  --magenta: #c2185b;
  --magenta-soft: #fce4ec;
  --green: #2e7d32;
  --green-dark: #1b5e20;
  --green-soft: #e8f5e9;
  --gold: #f9a825;
  --gold-soft: #fff8e1;
  --coral: #ff6f43;
  --sky: #2196f3;

  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-mute: #757575;
  --bg: #fffaf0;
  --bg-alt: #f5f0e6;
  --card: #ffffff;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.14);
  --radius: 14px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background:
    radial-gradient(circle at 12% 15%, rgba(249, 168, 37, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(194, 24, 91, 0.30) 0%, transparent 50%),
    radial-gradient(circle at 50% 110%, rgba(46, 125, 50, 0.45) 0%, transparent 55%),
    linear-gradient(160deg, #2a4a85 0%, var(--navy) 50%, var(--navy-dark) 100%);
  color: white;
  padding: 36px 0 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 3px at 15% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(circle 2px at 80% 30%, rgba(249,168,37,0.8), transparent),
    radial-gradient(circle 3px at 30% 70%, rgba(194,24,91,0.7), transparent),
    radial-gradient(circle 2px at 65% 85%, rgba(255,255,255,0.5), transparent);
  pointer-events: none;
}

.hero .kicker {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.hero h1 {
  margin: 0 0 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.title-line-1 {
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.title-line-2 {
  font-size: clamp(1.5rem, 5.5vw, 2.2rem);
  color: white;
  background: var(--green);
  padding: 6px 22px;
  border-radius: 8px;
  display: inline-block;
  transform: rotate(-1.5deg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.baseline {
  margin: 14px 0 8px;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.92;
}

.badge-free {
  display: inline-block;
  background: var(--gold);
  color: #4a2c00;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 12px rgba(249, 168, 37, 0.4);
}

/* valeurs sous le titre */
.values {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.values li {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(6px);
}

.values .v-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.values .v-label {
  display: block;
  line-height: 1.1;
}

.values .v-sub {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* ============================================================
   NAV STICKY
   ============================================================ */
.anchor-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 250, 240, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 8px;
}

.anchor-nav a {
  flex: 1;
  max-width: 150px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 6px;
  border-radius: 10px;
  transition: background 0.15s;
}

.anchor-nav a:hover,
.anchor-nav a:active {
  background: var(--green-soft);
  color: var(--green-dark);
}

/* ============================================================
   SECTIONS GÉNÉRIQUES
   ============================================================ */
.section { padding: 36px 0 28px; }
.section-alt { background: var(--bg-alt); }

.section h2 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  color: var(--navy);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.section .lead {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 1rem;
}

.section .lead-sm {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* ============================================================
   INFOS PRATIQUES
   ============================================================ */
.section-info {
  padding-top: 24px;
  padding-bottom: 24px;
  background: linear-gradient(180deg, rgba(26, 58, 110, 0.04) 0%, transparent 100%);
}

.info-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

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

.info-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: white;
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.info-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.info-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--magenta);
}

.info-value {
  margin: 2px 0;
  font-weight: 700;
  color: var(--ink);
}

.info-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-mute);
}

/* ============================================================
   STATUS BAR (refresh)
   ============================================================ */
.status-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: white;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-live {
  background: #4caf50;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

#refresh-btn {
  border: none;
  background: var(--green);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#refresh-btn:active { transform: scale(0.92); }
#refresh-btn.spinning { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   CHIPS / LEGEND
   ============================================================ */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.chip-now        { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.chip-soon       { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.chip-done       { background: #eceff1; color: #546e7a; border-color: #cfd8dc; }
.chip-info       { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.chip-repas      { background: var(--gold-soft); color: #b08000; border-color: #ffd54f; }
.chip-sport      { background: var(--green-soft); color: var(--green-dark); border-color: #a5d6a7; }
.chip-chateau    { background: var(--magenta-soft); color: var(--magenta); border-color: #f48fb1; }
.chip-henna      { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.chip-maquillage { background: #ffe0f0; color: #ad1457; border-color: #f8bbd0; }
.chip-eau        { background: #e1f5fe; color: #01579b; border-color: #81d4fa; }
.chip-tresor     { background: #fff3e0; color: #e65100; border-color: #ffb74d; }
.chip-atelier    { background: #f1f8e9; color: #33691e; border-color: #c5e1a5; }
.chip-wc         { background: #eceff1; color: #455a64; border-color: #b0bec5; }

/* ============================================================
   ACTIVITÉS — grille
   ============================================================ */
.activities-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) { .activities-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 880px) { .activities-grid { grid-template-columns: 1fr 1fr 1fr; } }

.activity {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--green);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.15s, box-shadow 0.15s;
}

.activity:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.activity-emoji {
  font-size: 2.2rem;
  line-height: 1;
  flex: 0 0 auto;
}

.activity-body { flex: 1; min-width: 0; }

.activity-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}

.activity-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.activity-time {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--magenta);
}

/* couleur du bandeau par type */
.activity[data-type="sport"]      { border-top-color: var(--green); }
.activity[data-type="chateau"]    { border-top-color: var(--magenta); }
.activity[data-type="henna"]      { border-top-color: #6a1b9a; }
.activity[data-type="maquillage"] { border-top-color: #ad1457; }
.activity[data-type="eau"]        { border-top-color: var(--sky); }
.activity[data-type="tresor"]     { border-top-color: var(--coral); }
.activity[data-type="atelier"]    { border-top-color: var(--gold); }
.activity[data-type="repas"]      { border-top-color: var(--gold); }
.activity[data-type="info"]       { border-top-color: var(--navy); }

/* version "planning live" (avec heures et statut) */
.activity.is-now  { background: linear-gradient(90deg, #ffebee 0%, white 40%); border-top-color: #f44336; }
.activity.is-soon { background: linear-gradient(90deg, #fff3e0 0%, white 40%); }
.activity.is-done { opacity: 0.55; }

.hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 16px 0 0;
  font-style: italic;
}

/* ============================================================
   CARTE — image satellite + markers
   ============================================================ */
.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  background: #d7d2c4;
}

#map-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#map-image[src=""],
#map-image:not([src]) { visibility: hidden; }

.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e3d3 0%, #d7d2c4 100%);
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
}

.map-placeholder.hidden { display: none; }
.map-placeholder p { margin: 6px 0; }
.map-placeholder .small { font-size: 0.85rem; opacity: 0.75; }

.map-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.marker {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s;
  z-index: 2;
}

.marker:hover,
.marker:focus-visible {
  transform: translate(-50%, -100%) scale(1.1);
  z-index: 3;
}

.marker-pin {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--magenta);
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.marker-pin > span { transform: rotate(45deg); }

.marker-label {
  background: rgba(0, 0, 0, 0.78);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marker[data-type="info"]       .marker-pin { background: var(--navy); }
.marker[data-type="repas"]      .marker-pin { background: var(--gold); color: #4a2c00; }
.marker[data-type="sport"]      .marker-pin { background: var(--green); }
.marker[data-type="chateau"]    .marker-pin { background: var(--magenta); }
.marker[data-type="henna"]      .marker-pin { background: #6a1b9a; }
.marker[data-type="maquillage"] .marker-pin { background: #ad1457; }
.marker[data-type="eau"]        .marker-pin { background: var(--sky); }
.marker[data-type="tresor"]     .marker-pin { background: var(--coral); }
.marker[data-type="atelier"]    .marker-pin { background: var(--gold); color: #4a2c00; }
.marker[data-type="wc"]         .marker-pin { background: #455a64; }

.map-tooltip {
  position: absolute;
  background: white;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
  font-size: 0.85rem;
  max-width: 220px;
  z-index: 4;
  pointer-events: none;
  border-left: 4px solid var(--magenta);
}

.map-tooltip strong { display: block; margin-bottom: 2px; color: var(--navy); }
.map-tooltip span   { color: var(--ink-soft); font-size: 0.8rem; }

.map-attribution {
  position: absolute;
  bottom: 4px;
  right: 8px;
  margin: 0;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Mode édition */
.edit-banner {
  margin: 12px 0 0;
  background: #fff3e0;
  border: 2px dashed var(--coral);
  padding: 10px 14px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.edit-banner p { margin: 0; font-size: 0.85rem; color: #5d3a0e; }

.edit-banner button {
  background: var(--coral);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.edit-output {
  margin-top: 10px;
  background: #1e1e1e;
  color: #e0e0e0;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
}

.map-wrap.editing { cursor: crosshair; }
.map-wrap.editing .map-markers { opacity: 0.5; }

/* ============================================================
   REPAS
   ============================================================ */
.meals-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

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

.meal-card {
  background: white;
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--gold);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.meal-icon { font-size: 2rem; line-height: 1; flex: 0 0 auto; }
.meal-title { margin: 0 0 4px; color: var(--navy); font-weight: 800; font-size: 1.02rem; }
.meal-desc { margin: 0; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.4; }

/* ============================================================
   À PRÉVOIR
   ============================================================ */
.prevoir-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

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

.prevoir-grid li {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 4px solid var(--magenta);
}

.prevoir-icon { font-size: 2.4rem; line-height: 1; display: block; margin-bottom: 6px; }
.prevoir-label { margin: 0; font-weight: 800; color: var(--navy); font-size: 1rem; }
.prevoir-sub { margin: 4px 0 0; font-size: 0.85rem; color: var(--ink-soft); }

/* ============================================================
   DON
   ============================================================ */
.donate-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .donate-grid { grid-template-columns: 1fr 1fr; }
  .donate-cash { grid-column: span 2; }
}

.donate-card {
  background: white;
  padding: 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--magenta);
}

.donate-card h3 { margin: 0 0 10px; font-size: 1.1rem; color: var(--magenta); }

.donate-qr     { border-top-color: var(--green); }
.donate-qr h3  { color: var(--green-dark); }
.donate-cash   { border-top-color: var(--gold); }
.donate-cash h3 { color: #b08000; }

.donate-card .label {
  margin: 8px 0 2px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  font-weight: 800;
}

.donate-card .value {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink);
  word-break: break-word;
}

.donate-card .value.iban {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  background: var(--green-soft);
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 4px;
}

.btn-secondary {
  margin-top: 12px;
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
}

.btn-secondary:active { background: var(--green-dark); }

.qr-box {
  background: white;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.qr-box img,
.qr-box canvas { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) { .contact-list { grid-template-columns: 1fr 1fr; } }

.contact-list li {
  background: white;
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-list a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
}

.contact-list a:hover { text-decoration: underline; }
.contact-list .c-icon { font-size: 1.6rem; line-height: 1; }
.contact-list .c-label { margin: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); font-weight: 800; }
.contact-list .c-value { margin: 2px 0 0; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: white;
  padding: 28px 0;
  text-align: center;
  margin-top: 24px;
}

footer p { margin: 4px 0; }
.org-name { font-size: 1.3rem; font-weight: 900; letter-spacing: 0.04em; }
.org-long { font-size: 0.95rem; opacity: 0.9; }
.small { font-size: 0.82rem; opacity: 0.75; }
.tiny { font-size: 0.75rem; opacity: 0.55; margin-top: 12px !important; }

/* ============================================================
   A11Y
   ============================================================ */
a:focus-visible,
button:focus-visible,
.marker:focus-visible .marker-pin {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}
