/* =====================================================================
   Braillard — Page Programme (Theory Masterclass)
   Module = carte (image 380px + inscription forfait) | liste de cours (accordéon).
   Mesures Figma : carte 380px, gouttière 170px, échelle 1728.
   ===================================================================== */

.br-programme{ font-family: var(--br-font-body); color: var(--br-black); }

/* ---- Un module : carte (gauche) + cours (droite) ---- */
.br-prog-module{
  display: grid;
  grid-template-columns: 380px 1fr;
  column-gap: 170px;
  align-items: start;
  padding: clamp(40px, 5vw, 96px) 0;
  border-top: 1px solid rgba(0,0,0,.14);
}
.br-prog-module:first-child{ border-top: 0; padding-top: 0; }

/* =========================== CARTE MODULE =========================== */
.br-prog-card{ position: sticky; top: 210px; }
@media (max-width: 900px){ .br-prog-card{ position: static; } }

/* Media : image (ou aplat couleur) sombre, n° + titre incrustés en bas. */
.br-prog-card__media{
  position: relative;
  min-height: clamp(360px, 34vw, 480px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(20px, 1.9vw, 32px);
  background: var(--br-prog-color, #2b2b2b);
  overflow: hidden;
  color: #fff;
}
.br-prog-card__media.has-img{ background: var(--br-prog-img) center/cover no-repeat, var(--br-prog-color, #2b2b2b); }
/* voile sombre pour lisibilité du texte incrusté */
.br-prog-card__media::after{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.62) 100%);
  z-index: 0;
}
.br-prog-card__num{
  position: relative; z-index: 1;
  font-family: var(--br-font-display, "PP Eiko"), serif; font-style: italic;
  font-size: clamp(40px, 4vw, 64px); line-height: 1; margin-bottom: .35em; color: #fff;
}
.br-prog-card__title{
  position: relative; z-index: 1;
  font-family: var(--br-font-body) !important; font-weight: 500 !important; font-style: normal !important;
  font-size: clamp(20px, 1.6vw, 26px); line-height: 1.2; margin: 0; color: #fff;
}

/* Méta sous l'image : dates · lieu */
.br-prog-card__meta{
  display: flex; flex-wrap: wrap; gap: .2em 1.2em;
  margin: clamp(14px, 1.4vw, 20px) 0 clamp(18px, 1.8vw, 26px);
  font-size: clamp(14px, 1.02vw, 16px); color: #6b6660;
}

/* Bouton « S'inscrire à la session » : plein sombre, pleine largeur de la carte */
.br-prog-card__cta{
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 15px 20px; text-decoration: none;
  background: var(--br-black); color: var(--br-white);
  font-size: clamp(14px, 1.02vw, 16px); letter-spacing: .01em;
  border: 1px solid var(--br-black);
  transition: background .2s ease, color .2s ease;
}
.br-prog-card__cta:hover{ background: transparent; color: var(--br-black); }
.br-prog-card__cta-price{ font-weight: 500; white-space: nowrap; }

/* =========================== LISTE COURS =========================== */
.br-prog-courses{ list-style: none; margin: 0; padding: 0; }
.br-prog-course{ border-top: 1px solid rgba(0,0,0,.14); }
.br-prog-course:first-child{ border-top: 0; }

/* Mode annonce (session à venir, ex. 2027) : cours en TITRE seul, non cliquable. */
.br-prog-course--annonce{ padding: clamp(10px, 1vw, 14px) 0; cursor: default; }
.br-prog-course--annonce .br-prog-course__title{ margin: 0; font-weight: 400 !important; color: #6b6660; font-size: clamp(15px, 1.1vw, 17px); }

.br-prog-course__head{
  position: relative;
  padding: clamp(20px, 2vw, 30px) 150px clamp(20px, 2vw, 30px) 0;
  cursor: pointer;
}
.br-prog-course__title{
  font-family: var(--br-font-body) !important; font-weight: 500 !important; font-style: normal !important;
  font-size: clamp(18px, 1.35vw, 22px); line-height: 1.25; margin: 0 0 .35em; color: var(--br-black);
}
.br-prog-course__meta{
  margin: 0; font-size: clamp(13px, .95vw, 15px); color: #6b6660; line-height: 1.5;
}
.br-prog-course__when::after{ content: " ·"; color: #b7b2ab; }
.br-prog-course__interv{ color: var(--br-black); text-decoration: underline; text-underline-offset: 2px; }
.br-prog-course__interv:hover{ opacity: .6; }

/* « En savoir plus » + icône ⊕ à droite */
.br-prog-course__more{
  position: absolute; top: clamp(20px, 2vw, 30px); right: 0;
  display: inline-flex; align-items: center; gap: 12px;
  font-size: clamp(13px, .95vw, 15px); color: var(--br-black); white-space: nowrap;
}
.br-prog-course__ico{
  position: relative; width: 22px; height: 22px; border: 1px solid var(--br-black); border-radius: 50%;
  flex: 0 0 22px; transition: background .2s ease;
}
.br-prog-course__ico::before,
.br-prog-course__ico::after{
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--br-black); transition: opacity .2s ease, transform .2s ease;
}
.br-prog-course__ico::before{ width: 10px; height: 1px; }             /* barre horizontale */
.br-prog-course__ico::after{ width: 1px; height: 10px; }              /* barre verticale (le +) */
.br-prog-course__head[aria-expanded="true"] .br-prog-course__ico::after{ opacity: 0; } /* + -> − */

/* Flèche « carte -> liste des cours » (maquette Avrile, #66) : FIXE, centrée
   verticalement sur l'IMAGE de la carte (retour client), dans la gouttière
   carte/liste (170px), pointe à 25px du bord de la liste. Même dessin ligne +
   crochet que les autres flèches du site (105×25). Indépendante des cours
   (visible en mode annonce comme en mode normal).
   Ancrée sur .br-prog-card (positionnée, sans overflow) et non sur l'image :
   celle-ci est en overflow:hidden et ses ::before/::after sont déjà utilisés.
   Centre = ½ de la hauteur de l'image (min-height clamp(360px, 34vw, 480px)). */
.br-programme{ --br-prog-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 105 25' fill='none'%3E%3Cline y1='12.5' x2='105' y2='12.5' stroke='%23000'/%3E%3Cpath d='M105 12.5C98.3726 12.5 93 7.12742 93 0.5' stroke='%23000'/%3E%3Cpath d='M105 12.5C98.3726 12.5 93 17.8726 93 24.5' stroke='%23000'/%3E%3C/svg%3E"); }
@media (min-width: 901px){
  .br-prog-card::before{
    content: ""; position: absolute; pointer-events: none; z-index: 2;
    right: -145px; width: 105px; height: 25px;
    top: calc(clamp(360px, 34vw, 480px) / 2);
    transform: translateY(-50%);
    background: var(--br-prog-arrow) no-repeat center / contain;
  }
}

/* Corps déplié : description + inscription au cours */
.br-prog-course__body{ padding: 0 clamp(0px, 6vw, 90px) clamp(22px, 2.4vw, 34px) 0; }
.br-prog-course__body[hidden]{ display: none; }
.br-prog-course__desc{
  font-size: clamp(15px, 1.05vw, 17px); line-height: 1.6; color: var(--br-black);
  margin: 0 0 clamp(18px, 1.8vw, 26px);
}
.br-prog-course__desc p{ margin: 0 0 .8em; }
.br-prog-course__desc p:last-child{ margin-bottom: 0; }

/* Bouton « S'inscrire au cours » : filaire noir (charte boutique) */
.br-prog-course__cta{
  display: inline-flex; align-items: baseline; gap: 12px;
  padding: 12px 20px; text-decoration: none;
  background: transparent; color: var(--br-black);
  border: 1px solid var(--br-black); border-radius: 0;
  font-size: clamp(13px, .98vw, 15px); letter-spacing: .01em;
  transition: background .2s ease, color .2s ease;
}
.br-prog-course__cta:hover{ background: var(--br-black); color: var(--br-white); }
.br-prog-course__price{ font-weight: 500; white-space: nowrap; }

/* WooCommerce ajoute un lien « Voir le panier » après un bouton AJAX -> inutile
   ici (le panneau panier s'ouvre à la place). */
.br-prog-card__cta + .added_to_cart,
.br-prog-course__cta + .added_to_cart{ display: none !important; }
/* état « loading »/« added » WC sur nos boutons : garder l'apparence charte */
.br-prog-card__cta.loading, .br-prog-course__cta.loading{ opacity: .6; }

/* Description du module (champ « description » de la catégorie WooCommerce) :
   en tête de la colonne de droite, au-dessus de la liste des cours. En exergue :
   noir, même taille/graisse que les titres de cours. */
.br-prog-desc{
  margin: 0;
  padding-bottom: clamp(24px, 2.6vw, 40px);
  border-bottom: 1px solid rgba(0,0,0,.14);   /* trait de délimitation après la description */
  font-family: var(--br-font-body); font-weight: 500;
  font-size: clamp(18px, 1.35vw, 22px); line-height: 1.35; color: var(--br-black);
}
.br-prog-desc > :first-child{ margin-top: 0; }
.br-prog-desc > :last-child{ margin-bottom: 0; }

/* =========================== RESPONSIVE =========================== */
@media (max-width: 900px){
  .br-prog-module{ grid-template-columns: 1fr; row-gap: clamp(28px, 5vw, 44px); }
  .br-prog-course__head{ padding-right: 0; }
  .br-prog-course__more{ position: static; margin-top: 12px; }

  /* ---- Carte module façon fiche (maquette client 13.07) : photo en
     bandeau avec le n° incrusté, TITRE NOIR sous la photo, dates|lieu
     justifiés, description tronquée + « En savoir plus », CTA noir. ---- */
  .br-prog-card__media,
  .br-prog-card__media.has-img{
    background: none; padding: 0; min-height: 0;
    display: block; color: var(--br-black); overflow: visible;
  }
  .br-prog-card__media::before{
    content: ""; display: block; height: 340px;
    background: var(--br-prog-img, linear-gradient(var(--br-prog-color, #2b2b2b) 0 0)) center / cover no-repeat, var(--br-prog-color, #2b2b2b);
  }
  .br-prog-card__media::after{ display: none; }   /* voile desktop inutile */
  .br-prog-card__num{
    position: absolute; left: 20px; top: calc(340px - 1em - 20px);
    color: #fff; margin: 0;
  }
  .br-prog-card__title{ color: var(--br-black); margin: 16px 0 0; font-size: 22px; }
  .br-prog-card__meta{ justify-content: space-between; width: 100%; margin-bottom: 12px; }
  .br-prog-desc{ margin-bottom: 0; }
  /* CTA centré avec l'icône ⊕ (maquette) */
  .br-prog-card__cta{ justify-content: center; align-items: center; }
  .br-prog-card__cta::before{
    content: ""; flex: 0 0 22px; width: 22px; height: 22px;
    border: 1px solid currentColor; border-radius: 50%;
    background:
      linear-gradient(currentColor 0 0) center / 10px 1px no-repeat,
      linear-gradient(currentColor 0 0) center / 1px 10px no-repeat;
  }
}
