/* AEP – Cards (extrait agenda.css, version plugin)
   Objectif: affichage des .card dans une .grid
*/

/* === Thème ============================================================= */
:root{
  --bg:#ffffff; --panel:#ffffff; --muted:#e5e7eb; --text:#111111; --sub:#555555;
  --accent:#ff1616; --good:#198754; --warn:#d58512;
}
*{box-sizing:border-box}

/* Grille : 5 colonnes max */
.grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
@media (max-width:1200px){.grid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:820px){.grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:560px){.grid{grid-template-columns:repeat(1,1fr)}}

/* === BOUTONS AGENDA ==================================================== */
.agenda-btn{
  padding:4px 6px;
  border:1px solid var(--muted);
  background:var(--panel);
  color:var(--text);
  border-radius:10px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  justify-content:center;
}
.agenda-btn[aria-pressed="true"],
.agenda-btn.active{
  border-color:var(--accent);
  box-shadow:0 0 0 1px var(--accent) inset;
}
.agenda-btn.primary{
  background:#000;
  border-color:#000;
  color:#fff;
  font-weight:00;
  font-size: 13px;
}
.agenda-btn.linklike{
  border:1px solid var(--muted);
  background:#fff;
  color:var(--accent);
}

/* === CARDS ============================================================= */
/* État de base */
.card{
  font-family: "plantinlight", sans-serif, Arial;
  background: var(--panel);
  border: 1px solid var(--muted);
  border-radius: 1px;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  transition: background-color .2s ease, border-color .2s ease,
              box-shadow .2s ease, transform .2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
}

/* Images */
.card .thumb{
  transition: filter .2s ease, transform .2s ease;
  will-change: filter;
}

.card:hover,
.card:focus-within{
  box-shadow: 0 2px 6px rgba(0,0,0,.10), 0 10px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.card:hover .thumb,
.card:focus-within .thumb{
  filter: brightness(1.05) contrast(1.02) saturate(1.02);
}
@media (hover: hover) and (pointer: fine){
  .card:hover,
  .card:focus-within{ transform: translateY(-2px); }
}

/* La carte et son contenu occupent toute la hauteur */
.card .content{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.card .meta{ order: 0; }

/* Détails scrollables */
.card .details{
  order: 1;
  flex: 0 0 auto;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.card .details.open{
  flex: 1 1 auto;
  max-height: none;
  overflow: auto;
  padding-bottom: .5rem;
}

/* Footer actions collé en bas */
.card .actions{
  order: 2;
  margin-top: auto;
  padding-top: 12px;
}

/* Header card */
header-agenda{
  padding:16px 20px;
  border-bottom:1px solid var(--muted);
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  background:#fff;
}

/* Type + badges */
.type{
  font-size:16px;
  font-family:"InrocksSlab-ExtendedRegular", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.badge{
  font-weight:100;
  font-size:10px;
  padding:4px 8px;
  border-radius:5px;
  border:1px solid var(--muted);
  background:#fff;
  color:var(--sub);
}
.badge.good{border-color:var(--good);color:var(--good);background:#f4fff8}
.badge.warn{border-color:var(--warn);color:var(--warn);background:#fffaf2}

/* Titre sous l’image */
.title-block{
  padding:10px 12px;
  background:#fff;
  border-top:1px solid var(--muted)
}
.title{
  margin:0;
  font-size:15px;
  line-height:1.25;
  color:#111;
  font-family:"InrocksSlab-ExtendedBold", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Images : formats dynamiques */
.thumb{width:100%;display:block;object-fit:cover;background:#f2f4f7}
.thumb--full{aspect-ratio:auto}
.thumb--square{aspect-ratio:1/1}
.thumb--poster{aspect-ratio:12/18}
.thumb.placeholder{
  background:repeating-linear-gradient(45deg,#f2f4f7,#f2f4f7 10px,#eceff3 10px,#eceff3 20px);
  height:auto
}

/* Contenu */
.content{padding:12px;display:flex;flex-direction:column;gap:10px;background:#fff}
.meta{display:flex;flex-wrap:wrap;gap:6px;color:var(--sub);font-size:12px}
.pill{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:3px 8px;
  border:1px solid var(--muted);
  border-radius:1px;
  font-size:12px;
  color:var(--sub);
  background:#fff
}

/* Actions */
.actions{display:flex;gap:8px;align-items:center;margin-top:4px;flex-wrap:wrap}

/* Détails */
.details{display:none;border-top:1px solid var(--muted);padding:10px 12px;color:#333;font-size:13px;background:#fff}
.details.open{display:block}
.deflist{display:grid;gap:6px 10px;margin:8px 0 0}
.deflist dt{color:#222;font-weight:600}
.deflist dd{margin:0}

/* Thumb-wrap (badge overlay possible) */
.thumb-wrap{
  position: relative;
  width: 100%;
  display: block;
  background:#f2f4f7;
}
.thumb-wrap > .thumb{
  display:block;
  width:100%;
  height:auto;
  object-fit:cover;
}
.inrocks-badge{
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 69px;
  height: 69px;
  pointer-events: none;
  user-select: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}


/* AEP FIX: certains thèmes injectent height:0 inline -> on force l'affichage */
.aep-embed .aep-embed-list{
  height: auto !important;
  min-height: 1px !important;
  position: static !important; /* évite certains layouts "placeholder" */
}

/* Grille responsive avec largeur mini des cards */
.aep-embed .grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* <-- largeur mini */
  gap: 14px;
  align-items: start;
}

/* Le conteneur ne doit pas être trop étroit */
.aep-embed{
  width: 100%;
  max-width: 1200px;   /* ajuste si besoin */
  margin: 0 auto;
  padding: 0 12px;
}

/* La card prend toute la colonne */
.aep-embed .card{
  width: 100%;
  min-width: 0;
}
