/* L'agenda des Pastoureaux : feuille de style unique.
   Mobile uniquement, aucun CDN, aucune police externe. Ossature et palette
   reprises du foyer de mini-sites (ménage, travaux, paniers, portail) :
   neutres stone, bleu sarcelle sauge du logo pour l'identité, brun terre
   cuite pour ce qui attend confirmation. Titres en Cormorant Garamond
   auto-hébergée, comme le site de l'école. */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/cormorant-garamond-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
}

:root {
  --bg:#fafaf9; --card:#ffffff; --ink:#1c1917; --ink-2:#292524;
  --muted:#78716c; --muted-2:#8a837d; --line:#e7e5e4; --line-2:#d6d3d1;
  --brand:#235b5b; --brand-2:#1b4949; --brand-clair:#b6d8d8;
  --brand-deco:#83b9b9; --brand-bg:#f2fafa; --brand-fonce:#1f5252;
  --entete:#92b6b6; --entete-tx:#123833; --entete-sous:#16453c;
  --terre:#a9762f; --terre-bg:#f8f1e6; --terre-tx:#5c4327; --terre-ln:#e3d2b6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
button, input { font-family: inherit; }

.chargement { padding: 40vh 0 0; text-align: center; color: var(--muted-2); }

/* ---- En-tête de marque : il défile, il ne colle pas -------------------- */

header.app {
  background: var(--entete); color: var(--entete-tx);
  padding: calc(18px + env(safe-area-inset-top)) 20px 16px;
  display: flex; align-items: center; gap: 15px;
}
header.app .logo {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.55);
}
header.app h1 {
  margin: 0; font-size: 24px; line-height: 1.15; font-weight: 600; min-width: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
}
header.app h1 .sub {
  display: block; color: var(--entete-sous); font-size: 15px;
  font-style: italic; font-weight: 400;
}

/* ---- Le fil des dates -------------------------------------------------- */

main { flex: 1; padding: 6px 16px 40px; }

.fil { position: relative; margin: 0; padding: 10px 0 0; list-style: none; }
.fil::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 25px;
  width: 2px; background: var(--brand-clair); border-radius: 1px;
}

/* Séparateur de mois : petite capitale posée sur le fil. */
.mois {
  position: relative; margin: 22px 0 10px; padding-left: 66px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px; font-weight: 600; color: var(--brand);
}
.mois::before {
  content: ""; position: absolute; left: 21px; top: 50%;
  width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--brand-deco); box-shadow: 0 0 0 3px var(--bg);
}
.fil > .mois:first-child { margin-top: 4px; }

/* Une ligne, un événement. */
.evt {
  position: relative; display: grid;
  grid-template-columns: 52px 1fr; gap: 0 14px;
  padding: 9px 0; align-items: center;
}
.evt .icone {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line-2);
  box-shadow: 0 1px 4px rgba(28, 25, 23, .07);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.evt .icone img { width: 40px; height: 40px; object-fit: contain; }
.evt .texte { min-width: 0; }
.evt .date {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand);
}
.evt .date .rel { margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-2); font-size: 12.5px; white-space: nowrap; }
.evt .titre { font-size: 16.5px; font-weight: 600; color: var(--ink); margin-top: 1px; }
.evt .detail { font-size: 13.5px; color: var(--muted); margin-top: 1px; }

.puce {
  display: inline-block; vertical-align: 2px; margin-left: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: none;
  border-radius: 999px; padding: 1px 8px; line-height: 1.5;
}
.puce.confirmer { background: var(--terre-bg); color: var(--terre-tx); border: 1px solid var(--terre-ln); }
.puce.encours { background: var(--brand-bg); color: var(--brand-2); border: 1px solid var(--brand-clair); }

/* Le passé : présent mais éteint. */
.evt.passe .icone { filter: grayscale(.75); opacity: .75; }
.evt.passe .date { color: var(--muted-2); }
.evt.passe .titre { color: var(--muted); font-weight: 500; }
.evt.passe .detail, .evt.passe .date .rel { color: var(--muted-2); }
.mois.passe { color: var(--muted-2); }
.mois.passe::before { background: var(--line-2); }

/* ---- La barre d'aujourd'hui -------------------------------------------- */

.aujourdhui {
  position: relative; display: flex; align-items: center; gap: 10px;
  margin: 16px 0; padding: 0;
}
.aujourdhui .trait { flex: 1; height: 2px; background: var(--brand); border-radius: 1px; }
.aujourdhui .etiquette {
  flex-shrink: 0; background: var(--brand); color: #ffffff;
  font-size: 13px; font-weight: 700; letter-spacing: .03em;
  border-radius: 999px; padding: 5px 14px;
  box-shadow: 0 2px 8px rgba(31, 82, 82, .25);
}

/* ---- Bouton flottant « Aujourd'hui » ----------------------------------- */

.btn-aujourdhui {
  position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20; border: none; cursor: pointer;
  background: var(--brand); color: #ffffff;
  font-size: 14.5px; font-weight: 700;
  border-radius: 999px; padding: 12px 18px; min-height: 48px;
  box-shadow: 0 4px 14px rgba(31, 82, 82, .35);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.btn-aujourdhui.visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---- Porte d'accès ------------------------------------------------------ */

.porte { padding: 34px 22px; text-align: center; }
.porte h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600; font-size: 26px; color: var(--brand-fonce); margin: 0 0 6px;
}
.porte .hint { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.porte form { display: flex; gap: 10px; max-width: 340px; margin: 0 auto; }
.porte input {
  flex: 1; min-width: 0; font-size: 17px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--card);
}
.porte button {
  font-size: 16px; font-weight: 700; padding: 12px 20px; min-height: 48px;
  background: var(--brand); color: #fff; border: none; border-radius: 12px; cursor: pointer;
}
.porte .erreur { color: var(--terre-tx); background: var(--terre-bg); border: 1px solid var(--terre-ln); border-radius: 10px; padding: 8px 12px; font-size: 14px; max-width: 340px; margin: 14px auto 0; }

.notice { text-align: center; color: var(--muted); padding: 30px 20px; }

/* ---- Pied -------------------------------------------------------------- */

footer {
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  text-align: center; color: var(--muted-2); font-size: 13px;
}
footer .filet {
  width: 74px; height: 2px; border-radius: 1px;
  background: var(--brand-deco); margin: 0 auto 12px;
}
