:root{
  --brand:#c0392b;
  --ink:#222;
  --muted:#666;
  --bg:#faf9f7;
  --card:#ffffff;
  --pill:#f2e9e4;
  --shadow:0 8px 24px rgba(0,0,0,.08);
  --radius:18px;
  --radius-lg:26px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* =========================
   HEADER + NAV (unifié)
   ========================= */
.site-header{
  position:sticky; top:0; z-index:1000;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:10px 16px;
  background:#fff;                 /* header blanc (cohérent site) */
  border-bottom:2px solid var(--brand);
  box-shadow:var(--shadow);
}
.brand{display:flex; align-items:center; gap:10px; min-width:0;}
.brand h1{
  font-family:'Yuji Syuku','Inter',sans-serif;
  font-size:20px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0;
}

/* Torii */
.torii{ width:42px; height:28px; position:relative; }
.torii::before, .torii::after{
  content:""; position:absolute; left:0; right:0; background:var(--brand); border-radius:2px;
}
.torii::before{ top:0; height:6px; }
.torii::after{ top:8px; height:5px; left:4px; right:4px; }
.torii span{display:none}
.torii + h1{ margin-left:4px; }

/* NAV desktop par défaut */
.site-nav{
  display:flex; align-items:center; gap:8px;
  flex-wrap:nowrap;            /* évite le passage sur 2 lignes */
  white-space:nowrap;          /* force les liens sur une ligne */
  max-width:100%;
}
.btn{
  background:var(--brand); color:#fff; padding:8px 12px; border-radius:8px;
  text-decoration:none; font-family:'Inter',sans-serif; font-weight:600; line-height:1;
  display:inline-block;
}
.btn:hover{ background:#a83227; }
.btn.logout{ background:#eee; color:#444; }
.btn.logout:hover{ background:#ddd; }

/* Burger : caché en desktop */
.nav-toggle{
  display:none; appearance:none; border:none; background:transparent; font-size:26px;
  line-height:1; padding:8px; border-radius:8px; cursor:pointer;
}
.nav-toggle:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* Mobile : menu déroulant */
@media (max-width: 720px){
  .brand h1{ font-size:18px; }

  /* le burger apparaît */
  .nav-toggle{ display:block; }

  /* la nav se replie */
  .site-nav{
    position:absolute; right:10px; top:58px;
    display:none; flex-direction:column; align-items:stretch;
    background:#fff; padding:8px; border-radius:10px;
    box-shadow:0 10px 24px rgba(0,0,0,.12);
    min-width:60vw; max-width:85vw;
  }
  .site-nav.show{ display:flex; }
  .site-nav .btn{
    display:block; text-align:left; padding:12px 14px; border-radius:10px;
  }
}
@media (max-width: 360px){
  .brand h1{ font-size:16px; }
}
/* empêcher le scroll quand menu ouvert */
html.nav-open, body.nav-open{ overflow:hidden; }

/* =========================
   LAYOUT & UI
   ========================= */
.container{max-width:1100px;margin:24px auto;padding:0 16px}
.container.narrow{max-width:680px}

.section-title{margin:8px 0 18px 4px;font-size:18px;color:var(--muted)}

.card{
  background:var(--card);border-radius:var(--radius);padding:16px 16px 18px;
  box-shadow:var(--shadow);
}

/* Boutons secondaires (chips blancs) */
.btn--chip{
  background:#fff;color:var(--brand);border:none;border-radius:999px;
  padding:10px 16px;font-weight:700;text-decoration:none;display:inline-block;
  box-shadow:var(--shadow);
}

/* Formulaires */
label{display:block;margin:12px 0 10px;font-weight:600}
input[type="text"],input[type="password"],input[type="date"],
input[type="email"],textarea{
  width:100%;padding:12px 12px;border-radius:12px;border:1px solid #ddd;background:#fff;
  font-family:'Inter',sans-serif; font-size:15px;
}
input[type="file"]{display:block;margin-top:8px}

/* Alerts */
.alert{padding:12px 14px;border-radius:12px;margin:10px 0;font-weight:600}
.alert.error{background:#ffe8e6;color:#8a1f11}
.alert.success{background:#e6ffef;color:#116a2e}
.hint{color:var(--muted);font-size:13px}

/* =========================
   LISTE DES JOURS & CARTES
   ========================= */
.days-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px
}
.day-card{
  background:var(--card);border-radius:var(--radius);overflow:hidden;text-decoration:none;color:inherit;
  box-shadow:var(--shadow);display:flex;flex-direction:column
}
.day-card .thumbs{
  display:grid;grid-template-columns:repeat(3,1fr);gap:2px;background:#0002;min-height:120px
}
.day-card img{width:100%;height:120px;object-fit:cover;display:block}
.day-card .day-infos{padding:12px 12px 14px}
.day-date{font-weight:800}
.day-city{color:var(--muted);margin-top:4px}

.day-header{display:flex;align-items:center;gap:10px;margin:6px 0 14px}
.day-header h2{margin:0}
.pill{background:var(--pill);padding:6px 10px;border-radius:999px;color:#5a4943}

/* =========================
   GALERIE
   ========================= */
.gallery{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px
}
.photo{
  background:var(--card);border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow)
}
.photo img{width:100%;height:100%;display:block;object-fit:cover}
figcaption{padding:10px 12px}
figcaption .meta{display:flex;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:13px;margin-top:6px}
.maplink{text-decoration:none;color:var(--brand);font-weight:700}

.delete-form { text-align:right; margin:4px 0; }
.delete-btn {
  background:#e74c3c; color:#fff; border:none; border-radius:8px;
  padding:6px 10px; font-size:13px; cursor:pointer;
}
.delete-btn:hover { background:#c0392b; }

/* =========================
   LEAFLET
   ========================= */
#mapid{
  height:480px; width:100%;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin:20px 0 40px;
}
.leaflet-popup-content img{max-width:100%;height:auto;display:block;}

/* =========================
   FILTRES
   ========================= */
.filter-box{
  background:var(--card); box-shadow:var(--shadow);
  border-radius:var(--radius); padding:10px 14px; margin-bottom:16px;
  display:flex; align-items:center; gap:8px; font-weight:600;
}
.filter-box label{color:var(--muted);}
.filter-box select{
  flex:1; padding:8px 10px; border-radius:10px; border:1px solid #ccc;
}

/* =========================
   LIGHTBOX
   ========================= */
.lightbox-open { overflow:hidden; }
.lightbox-overlay img {
  max-width:95vw; max-height:90vh; object-fit:contain;
}
.lightbox-arrow{
  font-size:48px; color:#fff; cursor:pointer; user-select:none;
  text-shadow:0 2px 6px rgba(0,0,0,0.7);
  transition:transform .2s, opacity .2s; opacity:.8;
}
.lightbox-arrow:hover { transform:scale(1.2); opacity:1; }
.lightbox-overlay{ transition:opacity .3s ease; opacity:0; }
.lightbox-overlay.visible{ opacity:1; }

/* =========================
   FOOTER
   ========================= */
.site-footer{padding:30px 16px;color:var(--muted);text-align:center}

/* sélection sur la vignette */
.pick{position:absolute;top:8px;left:8px;z-index:3;display:flex;align-items:center;gap:6px;cursor:pointer}
.pick input{display:none}
.pick .box{width:20px;height:20px;border:2px solid #fff;border-radius:4px;box-shadow:0 2px 6px rgba(0,0,0,.25);background:rgba(255,255,255,.3)}
.pick input:checked + .box{background:#e74c3c;border-color:#e74c3c}

/* bouton download unitaire */
.dl-one{
  position:absolute;top:8px;right:8px;z-index:3;
  background:rgba(255,255,255,.9);border-radius:8px;padding:6px 8px;text-decoration:none;
  box-shadow:0 2px 6px rgba(0,0,0,.25);font-size:16px
}
.dl-one:hover{background:#fff}

.photo {
  position: relative;
}

.uploader {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255,255,255,0.85);
  color: #333;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  z-index: 4;
}

/* Toolbar au-dessus de la liste */
.upload-toolbar{
  position: sticky; top: 64px; /* ajuste si l’en-tête est plus haut */
  z-index: 5;
  display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  background: var(--card);
  padding: 10px; margin-bottom: 10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.btn-light{ background:#f3f3f3; color:#333; }
.btn-light:hover{ background:#e9e9e9; }

/* Zone drag & drop */
.dropzone{
  border:2px dashed #ddd; border-radius: var(--radius);
  padding: 18px; text-align:center; color:#666; background:#fff; margin-bottom:10px;
}
.dropzone.dragover{ border-color: var(--brand); background:#fff6f5; }

/* Grille des fichiers (vignettes) */
.file-grid{
  display:grid; gap:12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-bottom: 12px;
}
.file-card{
  position:relative;
  background:#fff; border-radius:12px; box-shadow: var(--shadow);
  overflow:hidden; display:flex; flex-direction:column;
}
.file-card .thumb{
  width:100%; height:140px; object-fit:cover; background:#f5f5f5;
}
.file-card .meta{
  padding:8px 10px; font-size:13px; color:#555; display:flex; justify-content:space-between; gap:8px;
}
.file-card .status{
  position:absolute; top:8px; right:8px;
  background:rgba(255,255,255,.9); border-radius:8px; padding:2px 8px; font-size:12px; color:#333;
  box-shadow:0 2px 6px rgba(0,0,0,.2);
}
.file-card.error .status{ background:#ffe8e6; color:#8a1f11; }
.file-card.done  .status{ background:#e6ffef; color:#116a2e; }

