/* ─────────────────────────────────────────────
   flana.css — Styles globaux
   ───────────────────────────────────────────── */

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

:root {
  --terre:  #2C1810;
  --sable:  #F5EDD6;
  --tuile:  #C4602A;
  --mousse: #4A6741;
  --gris:   #8A8070;
  --creme:  #FBF7EE;
  --white:  #ffffff;
  --border: rgba(44,24,16,0.08);
  --shadow: 0 2px 16px rgba(44,24,16,0.07);
  --shadow-hover: 0 8px 32px rgba(44,24,16,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 99px;
}

html { scroll-behavior:smooth; }
body {
  background: var(--creme);
  color: var(--terre);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── TYPOGRAPHIE ── */
h1, h2, h3 { font-family: 'Playfair Display', serif; line-height: 1.15; }
em { color: var(--tuile); font-style: italic; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 2rem;
  background: rgba(251,247,238,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; color: var(--terre);
  text-decoration: none; flex-shrink: 0;
}
.nav-logo em { color: var(--tuile); font-style: italic; }
.nav-actions { display: flex; gap: 0.6rem; align-items: center; }
.btn-nav {
  background: var(--tuile); color: #fff;
  padding: 0.42rem 1rem; border-radius: var(--radius-pill);
  font-size: 0.8rem; font-weight: 500; text-decoration: none;
  transition: background .2s; white-space: nowrap;
}
.btn-nav:hover { background: var(--terre); }
.btn-prefs {
  background: transparent; border: 1.5px solid var(--border);
  color: var(--terre); padding: 0.38rem 0.9rem;
  border-radius: var(--radius-pill); font-size: 0.8rem;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: border-color .2s, color .2s; white-space: nowrap;
}
.btn-prefs:hover { border-color: var(--tuile); color: var(--tuile); }
.btn-back {
  font-size: 0.8rem; color: var(--gris);
  text-decoration: none; transition: color .2s;
}
.btn-back:hover { color: var(--tuile); }

/* ── BOUTONS ── */
.btn-primary {
  background: var(--terre); color: var(--sable);
  padding: 0.72rem 1.6rem; border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 500; text-decoration: none;
  display: inline-block; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--tuile); transform: translateY(-2px); }
.btn-outline {
  border: 1.5px solid var(--border); color: var(--terre);
  padding: 0.72rem 1.6rem; border-radius: var(--radius-pill);
  font-size: 0.88rem; text-decoration: none; display: inline-block;
  background: transparent; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color .2s, color .2s;
}
.btn-outline:hover { border-color: var(--tuile); color: var(--tuile); }

/* ── BADGES ── */
.badge {
  display: inline-block; font-size: 0.65rem; font-weight: 500;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
  letter-spacing: 0.3px;
}
.badge-date { background: var(--sable); color: var(--gris); }
.badge-urgent { background: #FCEBEB; color: #A32D2D; }
.badge-soon { background: #FAEEDA; color: #854F0B; }
.badge-later { background: #EAF3DE; color: #3B6D11; }
.badge-green { background: #EAF3DE; color: #3B6D11; }
.badge-orange { background: #FAEEDA; color: #854F0B; }
.badge-asso { background: #EEEDFE; color: #534AB7; }

/* ── CARTES ÉVÉNEMENTS ── */
.event-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.card-img {
  height: 140px; background-size: cover; background-position: center;
  flex-shrink: 0;
}
.card-img-placeholder {
  display: flex; align-items: center; justify-content: center;
}
.card-body { padding: 1rem 1.1rem; flex: 1; }
.card-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.card-cat {
  font-size: 0.62rem; letter-spacing: 1.5px; text-transform: uppercase;
  display: flex; align-items: center; gap: 5px; margin-bottom: 0.5rem;
  font-weight: 500;
}
.cat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; line-height: 1.3; margin-bottom: 0.6rem;
}
.card-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.card-meta span { font-size: 0.75rem; color: var(--gris); }
.card-footer {
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.card-dept {
  font-size: 0.7rem; background: var(--sable);
  padding: 0.18rem 0.55rem; border-radius: var(--radius-pill); color: var(--gris);
}

/* Carte petite (feed latéral) */
.event-card-small .card-img { height: 0; display: none; }
.event-card-small .card-title { font-size: 0.88rem; }
.event-card-small .card-body { padding: 0.8rem 0.9rem; }
.event-card-small .card-footer { padding: 0.55rem 0.9rem; }

/* ── GRILLES ── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* ── SECTION LABEL ── */
.section-tag {
  font-size: 0.65rem; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--tuile); font-weight: 500; margin-bottom: 0.5rem;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.2; margin-bottom: 1.25rem;
}

/* ── ÉTAT VIDE ── */
.empty-state {
  text-align: center; padding: 3rem 2rem;
  grid-column: 1 / -1;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; margin-bottom: 0.4rem;
}
.empty-state p { font-size: 0.875rem; color: var(--gris); line-height: 1.6; }

/* ── MODAL PRÉFÉRENCES ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(44,24,16,0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--creme); border-radius: 24px;
  padding: 2rem; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px);
  transition: transform .25s;
  position: relative;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
}
.modal-title {
  font-family: 'Playfair Display', serif; font-size: 1.4rem;
}
.modal-close {
  background: none; border: none; font-size: 1.2rem;
  cursor: pointer; color: var(--gris); padding: 0.25rem;
  line-height: 1; transition: color .2s;
}
.modal-close:hover { color: var(--tuile); }
.modal-section { margin-bottom: 1.5rem; }
.modal-section-title {
  font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gris); font-weight: 500; margin-bottom: 0.75rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.4rem 0.9rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); font-size: 0.78rem;
  cursor: pointer; background: transparent; color: var(--terre);
  font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.chip.selected { background: var(--tuile); color: #fff; border-color: var(--tuile); }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 1.5rem; }
.modal-actions .btn-primary { flex: 1; text-align: center; }
.btn-reset {
  background: none; border: 1.5px solid var(--border); color: var(--gris);
  padding: 0.72rem 1.1rem; border-radius: var(--radius-pill);
  font-size: 0.82rem; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: border-color .2s, color .2s;
}
.btn-reset:hover { border-color: var(--tuile); color: var(--tuile); }

/* ── SEARCH ── */
.search-wrap { position: relative; }
.search-input {
  width: 100%; padding: 0.7rem 1rem 0.7rem 2.6rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-pill);
  font-size: 0.88rem; font-family: 'DM Sans', sans-serif;
  background: var(--white); color: var(--terre);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-input:focus { border-color: var(--tuile); box-shadow: 0 0 0 3px rgba(196,96,42,.08); }
.search-icon {
  position: absolute; left: 0.9rem; top: 50%;
  transform: translateY(-50%); pointer-events: none; font-size: 0.85rem;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: var(--gris);
  max-width: 1200px; margin: 0 auto;
  flex-wrap: wrap; gap: 0.5rem;
}
.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--terre); text-decoration: none; }
.footer-logo em { color: var(--tuile); font-style: italic; }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--gris); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--tuile); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 0.7rem 1rem; }
  .btn-nav { font-size: 0.72rem; padding: 0.38rem 0.8rem; }
  .btn-prefs { font-size: 0.72rem; padding: 0.35rem 0.7rem; }
  footer { padding: 1rem; }
  .modal { padding: 1.5rem 1.25rem; }
}
@media (max-width: 480px) {
  .nav-actions { gap: 0.4rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
