/* =========================================================
   Salon Events (Plugin CSS)
   - Theme-agnostic
   - Fully scoped to plugin wrappers
   - One variables system (from BO): --se-primary, --se-primary-contrast, --se-card-bg, --se-border
   ========================================================= */

/* ---------- Base vars (fallbacks) ---------- */
.salon-events,
.se-single-event,
.se-single-speaker {
  --se-primary: var(--se-primary, #22c55e);
  --se-primary-contrast: var(--se-primary-contrast, #ffffff);
  --se-card-bg: var(--se-card-bg, #ffffff);
  --se-border: var(--se-border, #e5e7eb);

  --se-text: #111;
  --se-muted: rgba(0,0,0,.65);
  --se-soft: rgba(0,0,0,.04);
  --se-shadow: 0 14px 30px rgba(0,0,0,.08);
  --se-radius: 18px;
}

/* ---------- Utilities ---------- */
.se-is-hidden { display: none !important; }

/* =========================================================
   LISTING / PROGRAMME
   ========================================================= */

.salon-events {
  max-width: 1100px;
  margin: 0 auto;
}

/* Topbar */
.salon-events-topbar{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 14px;
  margin: 6px 0 16px;
  flex-wrap: wrap;
}

.salon-fav-link{
  font-weight: 600;
  text-decoration: none;
  color: var(--se-text);
  background: var(--se-soft);
  border: 1px solid var(--se-border);
  padding: 10px 12px;
  border-radius: 999px;
}
.salon-fav-link:hover{ opacity:.9; }

/* Tabs */
.salon-events-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 0 0 12px;
}

.salon-tab{
  border: 1px solid var(--se-border);
  background: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--se-text);
}
.salon-tab:hover{ background: var(--se-soft); }

.salon-tab.is-active{
  background: var(--se-primary);
  border-color: var(--se-primary);
  color: var(--se-primary-contrast);
  box-shadow: 0 0 0 2px var(--se-primary);
}

.salon-tab.is-active::before,
.salon-tab.is-active::after{
  background: var(--se-primary);
  border-color: var(--se-primary);
}

/* Filters */
.salon-events-filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 0 0 18px;
}

.salon-filter{
  border: 1px solid var(--se-border);
  background: #fff;
  padding: 10px 12px;
  border-radius: 999px;
  min-width: 170px;
}

.salon-filter-reset{
  border: 1px solid var(--se-border);
  background: var(--se-soft);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.salon-filter-reset:hover{ opacity:.9; }

.salon-tab:focus-visible,
.salon-filter:focus-visible,
.salon-filter-reset:focus-visible{
  outline: 2px solid var(--se-primary);
  outline-offset: 2px;
}

/* Grid */
.salon-events-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

@media (min-width: 1200px){
  .salon-events-grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px){
  .salon-events-grid{ grid-template-columns: 1fr; }
  .salon-filter{ min-width: 140px; }
}

/* ---------- Card ---------- */
.salon-event-card{
  position: relative;
  overflow: hidden;
  border-radius: var(--se-radius);
  border: 1px solid var(--se-border);
  background: var(--se-card-bg);
  box-shadow: var(--se-shadow);
  display:flex;
  flex-direction: column;
  min-height: 360px;
}

@media (max-width: 920px){
  .salon-event-card{ min-height: 340px; }
}

/* Top de la card */
.salon-card-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  padding: 14px 14px 0 14px;
}

/* Bouton favoris – version clean et maîtrisée */
.salon-fav-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;

  /* RESET critiques */
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;

  background-color: #fff;
  color: #000;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  /* UN SEUL effet visuel */
  box-shadow: 0 4px 10px rgba(0,0,0,.12);

  z-index: 3;
}

/* Hover */
.salon-fav-icon:hover {
  box-shadow: 0 6px 14px rgba(0,0,0,.16);
}

/* Focus clavier propre */
.salon-fav-icon:focus-visible {
  box-shadow: 0 0 0 2px rgba(0,0,0,.2);
}

/* État actif */
.salon-fav-icon.is-active {
  background-color: var(--se-primary);
  color: var(--se-primary-contrast);
}

/* Ligne avatars */
.salon-card-avatars {
    display: flex;
    align-items: center;
    padding-left: 4px; /* léger décalage esthétique */
}

.salon-card-avatars {
  margin-top: 4px;
}

/* Avatar individuel */
.salon-avatar {
    width: 42px;
    height: 42px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #eee;
    overflow: hidden;
}

/* Premier avatar bien aligné */
.salon-avatar:first-child {
    margin-left: 0;
}

/* Badge +X */
.salon-avatar-more {
    width: 42px;
    height: 42px;
    margin-left: -10px;
    border-radius: 50%;
    background: var(--se-primary);
    color: var(--se-primary-contrast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Body */
.salon-card-body{
  flex: 1 1 auto;
  padding: 28px 22px 18px;
}

.salon-card-title{
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.2;
  color: var(--se-text);
}

.salon-card-speaker{
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--se-muted);
}
.salon-card-speaker a{
  color: var(--se-primary);
  text-decoration: none;
  font-weight: 600;
}
.salon-card-speaker a:hover{ text-decoration: underline; }

/* Date / time */
.salon-card-date{
  font-weight: 800;
  margin: 6px 0 4px;
}
.salon-card-time{
  color: var(--se-muted);
  margin: 0 0 10px;
  font-size: 0.9rem;
  opacity: .9;
}

/* Location */
.salon-card-location{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: rgba(0,0,0,.70);
}
.salon-card-location a{
  color: inherit;
  text-decoration: none;
}

/* Tags */
.salon-card-tags{
  margin-top: 10px;
  font-size: 14px;
  color: var(--se-muted);
}
.salon-card-tags a{
  color: var(--se-text);
  text-decoration: underline;
  text-decoration-color: rgba(0,0,0,.25);
}
.salon-dot{ margin: 0 8px; opacity:.6; }

/* CTA */
.salon-card-cta{
  display:block;
  text-align:center;
  padding: 14px 20px;
  background: var(--se-primary);
  color: var(--se-primary-contrast);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .03em;
  font-size: 1.05rem;
  border-bottom-left-radius: var(--se-radius);
  border-bottom-right-radius: var(--se-radius);
  margin-top: auto;
}
.salon-card-cta:hover{ filter: brightness(.95); }

@media (max-width: 768px){
  .salon-card-cta{
    font-size: 1rem;
    padding: 12px 16px;
  }
}

/* =========================================================
   SINGLE EVENT / SINGLE SPEAKER (shared layout)
   ========================================================= */

.se-single-event,
.se-single-speaker {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 16px;
}

.se-single-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 960px) {
  .se-single-grid { grid-template-columns: 1fr; }
}

.se-hero-card {
  background: var(--se-card-bg);
  border: 1px solid var(--se-border);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  position: sticky;
  top: 90px;
}
@media (max-width: 960px) {
  .se-hero-card { position: relative; top: auto; }
}

.se-hero-avatar {
  display: flex;
  justify-content: center;
  margin-top: -62px;
  margin-bottom: 16px;
}
.se-hero-avatar img {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 6px solid var(--se-card-bg);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.se-hero-title {
  text-align: center;
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 10px;
}

.se-hero-sub {
  text-align: center;
  opacity: 0.7;
  margin-bottom: 6px;
}

.se-hero-speaker {
  text-align: center;
  margin-bottom: 16px;
}
.se-hero-speaker a {
  color: var(--se-primary);
  text-decoration: none;
  font-weight: 600;
}

.se-hero-date {
  text-align: center;
  font-weight: 700;
  margin-bottom: 10px;
}

.se-hero-price {
  text-align: center;
  margin-bottom: 18px;
  opacity: 0.9;
}

.se-hero-loc,
.se-hero-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--se-border);
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  opacity: 0.85;
}

.se-single-content {
  padding-top: 4px;
}

.se-back-btn {
  display: inline-block;
  background: var(--se-primary);
  color: var(--se-primary-contrast);
  padding: 12px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.se-back-btn:hover{ filter: brightness(.95); }

.se-single-body {
  background: transparent;
}
.se-single-body .se-empty {
  padding: 12px 0;
  opacity: 0.75;
}

.se-single-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--se-border);
}
.se-meta-row {
  margin: 8px 0;
}
.se-meta-row a {
  color: var(--se-primary);
  font-weight: 600;
  text-decoration: none;
}
.se-meta-row a:hover{ text-decoration: underline; }

/* Speaker extras */
.se-speaker-events { margin-top: 20px; }
.se-section-title { margin: 24px 0 14px; font-size: 22px; }

/* =========================================================
   THEME DEDUP (hide default title/meta only for our CPT)
   (kept minimal to avoid hiding plugin content)
   ========================================================= */

.single-se_event .entry-header,
.single-se_event header.entry-header,
.single-se_event .wp-block-post-title,
.single-se_event .entry-title,
.single-se_event .wp-block-post-author,
.single-se_event .wp-block-post-date,
.single-se_event .wp-block-post-featured-image,
.single-se_event .post-meta {
  display: none !important;
}

.single-se_speaker .entry-header,
.single-se_speaker header.entry-header,
.single-se_speaker .wp-block-post-title,
.single-se_speaker .entry-title,
.single-se_speaker .wp-block-post-author,
.single-se_speaker .wp-block-post-date,
.single-se_speaker .wp-block-post-featured-image,
.single-se_speaker .post-meta {
  display: none !important;
}

/* Hide the page title on the Favorites page (only where our shortcode renders) */
.salon-favorites-page .wp-block-post-title,
.salon-favorites-page .entry-title,
.salon-favorites-page header.entry-header,
.salon-favorites-page .entry-header {
  display: none !important;
}
/* =========================================================
   Salon Events — Favorites page cleanup
   Objectif :
   - Supprimer le titre du thème ("Mes favoris")
   - Ne garder QUE le titre + bouton gérés par le plugin
   - Aucun impact ailleurs sur le site
   ========================================================= */

/* Hide theme page title ONLY when favorites shortcode is present */
body.page:has(.salon-favorites-page) .wp-block-post-title,
body.page:has(.salon-favorites-page) .entry-title,
body.page:has(.salon-favorites-page) .entry-header,
body.page:has(.salon-favorites-page) header.entry-header {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Kill leftover spacing created by FSE wrappers */
body.page:has(.salon-favorites-page) main > .wp-block-group:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Favorites top bar layout */
.salon-favorites-page .salon-events-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Favorites title */
.salon-favorites-page h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0;
}

/* Export button (same style as event back button) */
.salon-favorites-page .se-back-btn {
  background: var(--se-primary);
  color: var(--se-primary-contrast);
  padding: 12px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.salon-favorites-page .se-back-btn:hover {
  filter: brightness(0.95);
}

/* Empty state */
.salon-favorites-page [data-favorites-empty] {
  opacity: 0.75;
  margin-top: 12px;
}

/* Grid spacing consistency */
.salon-favorites-page .salon-events-grid {
  margin-top: 24px;
}

.salon-card-avatars {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.salon-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    margin-left: -10px;
    background: #eee;
    display: inline-flex;
}

.salon-avatar:first-child {
    margin-left: 0;
}

.salon-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.salon-avatar-more {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--se-primary);
    color: var(--se-primary-contrast);
}

/* =========================
   SINGLE EVENT OVERRIDES
   ========================= */

.salon-event-single .salon-card-avatars {
  gap: 10px;
  padding-left: 0;
}

.salon-event-single .salon-avatar {
  margin-left: 0;
}

/* Optionnel : avatars un peu plus grands sur la page détail */
.salon-event-single .salon-avatar,
.salon-event-single .salon-avatar-more {
  width: 48px;
  height: 48px;
}

/* Speaker single: grid identical to programme */
.se-single-speaker .salon-events-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

@media (max-width: 980px){
  .se-single-speaker .salon-events-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  .se-single-speaker .salon-events-grid{
    grid-template-columns: 1fr;
  }
}

/* =========================
   Speaker page – listing events
   ========================= */

.se-single-speaker .salon-events-grid {
  margin-top: 18px;
}

.se-single-speaker .salon-event-card {
  width: 100%;
}

/* Optionnel : réduit la hauteur/espaces sur speaker page */
.se-single-speaker .salon-card-body {
  padding: 22px 20px 14px;
}

/* =========================
   UNIFORM LISTING LAYOUT
   ========================= */

/* Wrapper commun à tous les listings */
.salon-events[data-salon-events],
.salon-events[data-salon-favorites],
.salon-events[data-salon-events-init]{
  width: 100%;
  max-width: 1100px;   /* ajuste si tu veux plus large */
  margin: 0 auto;
  padding: 0 16px;
}

/* Assure que la grille occupe la largeur */
.salon-events-grid{
  width: 100%;
}

/* =========================
   SPEAKERS / EVENTS LISTING
   ========================= */

/* Wrapper principal des listings */
.se-speakers-list,
.se-events-list {
    max-width: 1200px; /* ajuste si besoin : 1280px possible */
    margin: 0 auto;
    padding: 0 24px;
}

/* Grille des intervenants */
.se-speakers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    align-items: stretch;
}

@media (min-width: 1200px) {
  .se-speakers-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .se-speakers-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .se-speakers-grid { grid-template-columns: 1fr; }
}

/* Bouton Découvrir : version discrète et cohérente */
.se-speaker-card {
    display: flex;
    flex-direction: column;
}

.se-speaker-card .se-card-cta,
.se-speaker-card .salon-card-cta {
    margin-top: 16px;
    align-self: center;

    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;

    border-radius: 999px;
    width: auto;
}

.se-speaker-card .se-card-cta { margin-top: auto; }

/* Carte intervenant : structure idéale */
.se-speaker-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 16px;
    object-fit: cover;
    display: block;
}

.se-speaker-name {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.se-speaker-count {
    font-size: 14px;
    color: var(--se-muted);
    text-align: center;
}
/* =========================
   REMOVE TOP GAP UNDER HEADER
   (Salon Events only)
   ========================= */

/* Supprime la marge haute du contenu quand un listing Salon est présent */
main:has(.salon-events){
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Cas fréquent : groupe FSE avec spacing auto */
main:has(.salon-events) > .wp-block-group{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Sécurité : premier bloc du listing */
.salon-events{
  margin-top: 0 !important;
}

/* =========================
   GLOBAL LISTING CONTAINER (MODEL)
   ========================= */

:root{
  --se-container: 1320px; /* ajuste si besoin (1280/1320) */
}

/* Tous les listings du plugin utilisent le même container */
.salon-events{
  width: 100%;
  max-width: var(--se-container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Débloque la contrainte FSE autour du listing */
.wp-site-blocks main:has(.salon-events){
  max-width: none !important;
}
main:has(.salon-events) .is-layout-constrained{
  max-width: none !important;
}


/* =========================
   SPEAKERS LISTING (MODEL LAYOUT)
   ========================= */

.salon-speakers-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
}

@media (max-width: 980px){
  .salon-speakers-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .salon-speakers-grid{ grid-template-columns: 1fr; }
}

.salon-speaker-card{
  border: 1px solid var(--se-border);
  background: var(--se-card-bg);
  border-radius: var(--se-radius, 22px);
  box-shadow: var(--se-shadow, 0 10px 30px rgba(0,0,0,.06));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.salon-speaker-avatar{
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  background: #eee;
  margin: 22px auto 0;
}

.salon-speaker-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.salon-speaker-avatar.is-placeholder{
  background: rgba(0,0,0,.06);
}

.salon-speaker-body{
  padding: 18px 22px 18px;
  flex: 1 1 auto;
}

.salon-speaker-name{
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
  color: var(--se-text);
}

.salon-speaker-meta{
  font-size: 14px;
  color: var(--se-muted);
}

/* CTA discret (comme les autres pages) */
.salon-speaker-cta{
  margin: 18px auto 22px;
  align-self: center;

  min-height: auto;
  padding: 10px 18px;
  border-radius: 999px;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;

  background: var(--se-primary);
  color: var(--se-primary-contrast);

  width: auto;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* =========================
   SINGLE EVENT – TEXT ALIGN LEFT
   ========================= */

.se-single-event,
.se-single-event * {
  text-align: left;
}

/* Titres */
.se-single-event h1,
.se-single-event h2,
.se-single-event h3 {
  text-align: left;
}

/* Meta (catégorie, intervenants, date, tarif, lieu) */
.se-single-event .salon-event-meta,
.se-single-event .salon-event-info,
.se-single-event .salon-event-date,
.se-single-event .salon-event-price,
.se-single-event .salon-event-location {
  text-align: left;
}

/* Ligne intervenants */
.se-single-event .salon-event-speakers {
  justify-content: flex-start;
}

/* =========================
   Speaker single: vertical list (1 per row)
   ========================= */

.se-events-vlist{
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.se-event-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 16px 18px;
  border: 1px solid var(--se-border);
  background: var(--se-card-bg);
  border-radius: 18px;
  box-shadow: var(--se-shadow, 0 10px 30px rgba(0,0,0,.06));

  text-decoration: none;
  color: inherit;
}

.se-event-row__main{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.se-event-row__title{
  font-size: 18px;
  font-weight: 700;
  color: var(--se-text);
  line-height: 1.2;
}

.se-event-row__meta{
  font-size: 14px;
  color: var(--se-muted);
}

.se-event-row__sep{
  margin: 0 8px;
  opacity: .6;
}

.se-event-row__loc{
  font-size: 13px;
  color: var(--se-muted);
  text-transform: uppercase;
  letter-spacing: .02em;
}

.se-event-row__cta{
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--se-primary);
  color: var(--se-primary-contrast);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}
