/* EKP Planning Styles v0.1.3 */
/* Pas de marge externe : gérée par le conteneur WP */
.ekp-planning { margin: 0; }

/* MOBILE (liste) */
.ekp-mobile { display: block; }
.ekp-desktop { display: none; }

.ekp-month { margin-bottom: 1.5rem; }
.ekp-month-title {
  display:flex; align-items: baseline; gap:.5rem;
  font-weight:700; letter-spacing:.2px; margin:.25rem 0 .75rem;
  justify-content:flex-start;
  border-left: 4px solid #6b7cff; padding-left: .5rem;
}
.ekp-month-title .ekp-month-year { font-size:.9em; color:#6B7280; }

.ekp-list { list-style: none; margin: 0; padding: 0; }
.ekp-card {
  border: 1px solid #E5E7EB; border-radius: 12px; padding: .75rem .9rem; margin-bottom: .75rem;
  background: #fff; box-shadow: 0 1px 0 rgba(16,24,40,.02);
}
.ekp-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .25rem; }
.ekp-date { font-weight: 600; }
.ekp-place { color: #374151; font-size: .95rem; margin: .15rem 0; }
.ekp-place-nom { font-weight:600; }
.ekp-note { margin-top: .35rem; font-size: .9rem; color: #6B7280; }

/* Badges */
.ekp-tag {
  display: inline-block; font-size: .78rem; line-height: 1; padding: .35rem .5rem; border-radius: 999px; font-weight: 600;
}
.ekp-planifié, .ekp-planifie { background: #E8FAF0; color: #05603A; border: 1px solid #A7F3D0; }
.ekp-passé, .ekp-passe { background: #F3F4F6; color: #374151; border: 1px solid #E5E7EB; }

/* DESKTOP (tableau) */
@media (min-width: 992px) {
  .ekp-mobile { display: none; }
  .ekp-desktop { display: block; }
}

.ekp-table-wrap { max-width: 1100px; margin: 0 auto; }

.ekp-table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; overflow: hidden;
  font-size: 0.95rem;
}
.ekp-table caption { text-align: left; font-weight: 700; padding: .6rem .9rem; }
.ekp-table thead th {
  position: sticky; top: 0; background: #F9FAFB; border-bottom: 1px solid #E5E7EB;
  padding: .45rem .55rem; text-align: center; font-weight: 700;
}
.ekp-th-week { text-align:left !important; }
.ekp-th-stack { display:flex; flex-direction:column; align-items:center; line-height:1.1; }
.ekp-th-year { font-size: .85em; color:#6B7280; margin-top:2px; }

.ekp-table tbody th.ekp-week {
  width: 80px; background: #F9FAFB; border-right: 1px solid #E5E7EB; padding: .45rem .55rem; text-align:left;
}
.ekp-table td { vertical-align: top; padding: .4rem .5rem; border-left: 1px solid #F3F4F6; border-top: 1px solid #F3F4F6; }

.ekp-empty { background: #F5F6F8; color: #9CA3AF; text-align: center; font-size: .9rem; }
.ekp-empty-dot { opacity: .6; }

.ekp-cell { display: grid; gap: .2rem; padding: .25rem .2rem; }
.ekp-cell-head { display: flex; align-items: center; justify-content: space-between; gap: .25rem; }
.ekp-cell-date { font-weight: 700; }
.ekp-cell-place { color: #374151; font-size: .9rem; }
.ekp-cell-nom { font-weight:600; }
.ekp-cell-note { color: #6B7280; font-size: .82rem; }



/* Étire le calendrier à la largeur du parent (desktop) */
@media (min-width: 992px) {
  .ekp-planning.ekp-desktop .ekp-table-wrap {
    max-width: none;   /* on enlève la limite 1100px du plugin */
    width: 100%;       /* prend toute la largeur disponible */
    margin: 0;         /* plus de centrage */
  }
  .ekp-planning.ekp-desktop .ekp-table {
    width: 100%;       /* le tableau occupe tout l'espace */
    table-layout: fixed; /* colonnes équilibrées, pas d'à-coups */
  }
  /* garde une première colonne raisonnable */
  .ekp-planning .ekp-table tbody th.ekp-week { width: 84px; }
  /* évite les débordements dans les cellules longues */
  .ekp-planning .ekp-table td,
  .ekp-planning .ekp-table th {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }
}
/* ----- Desktop only ----- */
@media (min-width: 992px) {
  /* 1) Pastille sous la date (dans chaque cellule) */
  .ekp-planning.ekp-desktop .ekp-cell-head {
    display: flex;
    flex-direction: column;      /* empile */
    align-items: flex-start;     /* aligné à gauche */
    gap: .25rem;
  }
  .ekp-planning.ekp-desktop .ekp-cell-date { order: 1; }
  .ekp-planning.ekp-desktop .ekp-cell-head .ekp-tag { order: 2; }

  /* petit spacing avant le lieu/nom */
  .ekp-planning.ekp-desktop .ekp-cell-place { margin-top: .15rem; }

  /* 2) Numéro de semaine centré H et V */
  .ekp-planning.ekp-desktop .ekp-table tbody th.ekp-week {
    display: grid;               /* permet place-items */
    place-items: center;         /* centre horizontal + vertical */
    text-align: center;
    vertical-align: middle;      /* ceinture & bretelles */
    padding: .45rem;             /* garde une respiration raisonnable */
  }
}
@media (min-width: 992px) {
  .ekp-planning.ekp-desktop .ekp-cell-head {
    gap: 0.22rem;               /* espace date ↔ pastille */
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ----- Desktop only : compaction + pastille sur la 1ʳᵉ ligne ----- */
@media (min-width: 992px) {
  /* 0) Laisse la table respirer mais en mode compact */
  .ekp-planning.ekp-desktop .ekp-table {
    /* si tu veux l’étirer en pleine largeur, garde table-layout: fixed */
    table-layout: fixed;
    font-size: 0.92rem;                 /* -3 à -5 % */
  }

  /* 1) En-têtes plus denses */
  .ekp-planning.ekp-desktop .ekp-table thead th {
    padding: .35rem .40rem;             /* était ~.45/.55 */
    font-size: .92em;                    /* un poil plus petit */
  }
  .ekp-planning.ekp-desktop .ekp-th-year {
    font-size: .78em;                    /* réduit l’année */
  }

  /* 2) Colonne "Semaine" centrée et compacte */
  .ekp-planning.ekp-desktop .ekp-table tbody th.ekp-week {
    width: 72px;                         /* était ~80+ */
    display: grid;
    place-items: center;                 /* centre H/V */
    text-align: center;
    padding: .35rem .40rem;
    font-size: .92em;
  }

  /* 3) Cellules plus compactes */
  .ekp-planning.ekp-desktop .ekp-table td {
    padding: .30rem .40rem;              /* était .4/.5 rem */
  }
  .ekp-planning.ekp-desktop .ekp-cell {
    gap: .14rem;                         /* espace vertical interne */
  }

  /* 4) Date + pastille sur la même ligne, sans retour à la ligne */
  .ekp-planning.ekp-desktop .ekp-cell-head {
    display: flex;
    flex-direction: row;                 /* sur une ligne */
    align-items: center;
    gap: .22rem;                         /* distance date ↔ pastille */
    white-space: nowrap;                 /* empêche le retour ligne */
  }
  .ekp-planning.ekp-desktop .ekp-cell-date {
    font-weight: 700;
    font-size: .98em;                    /* légèrement serré */
    line-height: 1.1;
  }

  /* 5) Pastille compacte (lisible) */
  .ekp-planning.ekp-desktop .ekp-tag {
    font-size: .72rem;                   /* plus petite */
    line-height: 1;
    padding: .18rem .42rem;              /* moins haute & moins large */
    border-radius: 999px;
  }

  /* 6) Texte lieu/nom un peu plus fin pour laisser respirer la 1ʳᵉ ligne */
  .ekp-planning.ekp-desktop .ekp-cell-place {
    font-size: .88rem;
  }
}
@media (min-width: 992px) {
  /* Réduire la colonne "Semaine" (entête + corps) */
  .ekp-planning.ekp-desktop .ekp-table thead th.ekp-th-week { width: 66px; }
  .ekp-planning.ekp-desktop .ekp-table tbody th.ekp-week {
    width: 66px;
    display: grid; place-items: center;
    text-align: center; padding: .35rem .35rem;
  }

  /* Date + pastille sur une ligne, avec marge autour de la pastille */
  .ekp-planning.ekp-desktop .ekp-cell-head {
    display: flex; align-items: center; gap: .28rem; /* un peu plus d’air */
    white-space: nowrap;
  }
  .ekp-planning.ekp-desktop .ekp-tag {
    font-size: .72rem; line-height: 1;
    padding: .18rem .44rem;
    margin-inline: .20rem;        /* marge à gauche ET à droite de la pastille */
  }
}
/* === Desktop only === */
@media (min-width: 992px) {
  /* 1) Colonne "Semaine" : fond gris sur TOUTE la cellule, sans pseudo-élément */
  .ekp-planning .ekp-table tbody th.ekp-week {
    background: #F3F4F6 !important;    /* gris doux */
    border-right: 1px solid #E5E7EB;
    text-align: center;
    vertical-align: middle;            /* centre vertical */
  }

  /* 2) Cellules vides : centre le tiret sans casser le modèle de tableau */
  .ekp-planning .ekp-table td.ekp-empty {
    background: transparent !important;
    text-align: center;
    vertical-align: middle;            /* centré verticalement */
  }
  .ekp-planning .ekp-table td.ekp-empty .ekp-empty-dot {
    display: inline-block;             /* pour un centrage propre */
    opacity: .55;                      /* discret mais visible */
    font-weight: 600;
  }

  /* 3) Sécurise : pas de flex/grid appliqué aux cellules (si restes de tests) */
  .ekp-planning .ekp-table td,
  .ekp-planning .ekp-table th {
    display: table-cell;
  }
}