/*
 * Agenda de l'école : calendrier du mois et liste des évènements.
 *
 * L'agenda n'était qu'une liste de quatre articles sans distinction entre ce
 * qui a eu lieu et ce qui vient. Un calendrier répond d'un coup d'oeil à la
 * seule question qu'on se pose : qu'est-ce qui arrive, et quand.
 */

:root {
  --ag-encre: #14243a;
  --ag-bleu: #1f5793;
  --ag-or: #c8a04a;
}

/* ------------------------------------------------------------ Le calendrier */

.cal {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 18px 20px 14px;
  box-shadow: 0 6px 20px rgba(20, 36, 58, .06);
}

.cal-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.cal-mois {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ag-encre);
  letter-spacing: -.01em;
}

.cal-nav {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ag-bleu);
  background: #eef3f9;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

.cal-nav:hover { background: var(--ag-bleu); color: #fff; }

/* Un mois sans rien n'est pas proposé : cliquer dans le vide n'apprend rien. */
.cal-nav.est-inactif {
  background: #f7f8fa;
  color: #d0d5dd;
  pointer-events: none;
}

.cal-grille {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.cal-grille th {
  padding: 6px 0 10px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #98a2b3;
  text-align: center;
}

.cal-grille th abbr { text-decoration: none; border: 0; }

.cal-grille td {
  padding: 2px;
  text-align: center;
  vertical-align: middle;
}

.cal-jour {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 9px;
  font-size: .87rem;
  color: var(--ag-encre);
}

.cal-grille td.hors-mois .cal-jour { color: #d0d5dd; }
.cal-grille td.est-passe .cal-jour { color: #98a2b3; }

.cal-grille td.est-aujourdhui .cal-jour {
  background: var(--ag-encre);
  color: #fff;
  font-weight: 700;
}

/* Une case porteuse d'évènement est cliquable dans son entier : viser une
   pastille de six pixels ne marche pas au doigt. */
.cal-grille td a {
  display: block;
  border-radius: 9px;
  text-decoration: none;
  transition: background .16s ease;
}

.cal-grille td.a-evenement a:hover { background: #f4f7fb; }
.cal-grille td.a-evenement .cal-jour { font-weight: 700; color: var(--ag-bleu); }
.cal-grille td.a-evenement.est-passe .cal-jour { color: #667085; }
.cal-grille td.est-aujourdhui.a-evenement .cal-jour { color: #fff; }

.cal-points {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 8px;
  margin-top: -3px;
}

.cal-point {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ag-or);
  display: inline-block;
}

.cal-grille td.est-passe .cal-point { background: #cbd2da; }

.cal-legende {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  color: #98a2b3;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #f2f4f7;
}

.cal-compact { padding: 14px 16px 10px; }
.cal-compact .cal-jour { height: 30px; font-size: .82rem; }

/* --------------------------------------------------- Liste des évènements */

.ag-liste { list-style: none; margin: 0; padding: 0; }

.ag-liste li { border-bottom: 1px solid #eef1f5; }
.ag-liste li:last-child { border-bottom: 0; }

.ag-liste a {
  display: flex;
  gap: 14px;
  padding: 14px 2px;
  text-decoration: none;
  transition: background .16s ease;
  border-radius: 10px;
}

.ag-liste a:hover { background: #f7f9fc; }

.ag-date {
  flex: 0 0 54px;
  width: 54px;
  border-radius: 10px;
  background: #eef3f9;
  color: var(--ag-bleu);
  text-align: center;
  padding: 7px 0 6px;
  align-self: flex-start;
}

.ag-date b { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1; }
.ag-date i {
  display: block;
  font-style: normal;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 3px;
}

/* Un évènement passé s'efface, mais reste consultable. */
.ag-liste li.est-passe .ag-date { background: #f2f4f7; color: #98a2b3; }
.ag-liste li.est-passe .ag-titre { color: #667085; }

.ag-corps { min-width: 0; flex: 1; }

.ag-titre {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ag-encre);
  line-height: 1.35;
  margin-bottom: 4px;
}

.ag-extrait {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .84rem;
  color: #667085;
  line-height: 1.5;
  margin: 0;
}

.ag-heure { font-size: .76rem; color: #98a2b3; margin-top: 4px; display: block; }

.ag-bloc-titre {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #667085;
  margin: 0 0 8px;
}

.ag-bloc-titre::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(200, 160, 74, .45), transparent);
}

.ag-vide {
  padding: 22px 16px;
  border: 1px dashed #dfe3e8;
  border-radius: 12px;
  color: #98a2b3;
  font-size: .87rem;
  text-align: center;
}

@media (max-width: 575px) {
  .cal { padding: 14px 12px 10px; }
  .cal-jour { height: 30px; font-size: .8rem; }
  .cal-grille th { font-size: .62rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cal-nav, .cal-grille td a, .ag-liste a { transition: none; }
}

/* ==================================================================
   Panneau de la section agenda de l'accueil

   Le fond de cette section est une mosaïque de zellige dense et
   multicolore. Tout texte posé dessus devient illisible — c'est ce qui
   arrivait à la liste des évènements, qui n'avait pas de fond à elle.
   Les deux colonnes reposent donc sur une carte, titre compris.
   ================================================================== */

.ag-panneau {
  background: #fff;
  border: 1px solid rgba(228, 231, 236, .9);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 10px 30px rgba(20, 36, 58, .1);
  height: 100%;
}

.ag-section-titre {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ag-encre);
  line-height: 1.1;
  margin: 0;
}

/* Le calendrier posé dans un panneau ne porte plus sa propre carte :
   deux cadres emboîtés se verraient. */
.cal-nu {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 575px) {
  .ag-panneau { padding: 16px 14px; }
  .ag-section-titre { font-size: 1.25rem; }
}
