/*
 * WP Événements — Frontend CSS
 * Inspiré WooCommerce : clean, lisible, mobile-first
 */

/* ══════════════════════════════════════════════════════════════
   VARIABLES
══════════════════════════════════════════════════════════════ */
:root {
  --wpe-primary:     #2c3e50;
  --wpe-accent:      #3498db;
  --wpe-accent-h:    #2980b9;
  --wpe-border:      #e2e8f0;
  --wpe-bg:          #f8fafc;
  --wpe-text:        #2d3748;
  --wpe-muted:       #718096;
  --wpe-radius:      10px;
  --wpe-shadow:      0 2px 12px rgba(0,0,0,.06);
  --wpe-shadow-h:    0 8px 24px rgba(0,0,0,.10);
  --wpe-transition:  .18s ease;

  /* Statuts */
  --wpe-planifie-c: #2563eb; --wpe-planifie-bg: #eff6ff;
  --wpe-ouvert-c:   #16a34a; --wpe-ouvert-bg:   #f0fdf4;
  --wpe-complet-c:  #dc2626; --wpe-complet-bg:  #fef2f2;
  --wpe-annule-c:   #6b7280; --wpe-annule-bg:   #f3f4f6;
  --wpe-termine-c:  #92400e; --wpe-termine-bg:  #fffbeb;
}

/* ══════════════════════════════════════════════════════════════
   BADGES STATUT (partagés grille + liste + single)
══════════════════════════════════════════════════════════════ */
.wpe-statut-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; white-space: nowrap;
}
.wpe-statut-badge--planifie { color: var(--wpe-planifie-c); background: var(--wpe-planifie-bg); }
.wpe-statut-badge--ouvert   { color: var(--wpe-ouvert-c);   background: var(--wpe-ouvert-bg);   }
.wpe-statut-badge--complet  { color: var(--wpe-complet-c);  background: var(--wpe-complet-bg);  }
.wpe-statut-badge--annule   { color: var(--wpe-annule-c);   background: var(--wpe-annule-bg);   }
.wpe-statut-badge--termine  { color: var(--wpe-termine-c);  background: var(--wpe-termine-bg);  }

/* ══════════════════════════════════════════════════════════════
   CATÉGORIES TAGS
══════════════════════════════════════════════════════════════ */
.wpe-cat-tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  background: var(--wpe-bg); border: 1px solid var(--wpe-border);
  font-size: 11px; font-weight: 600; color: var(--wpe-muted);
  text-decoration: none; transition: all var(--wpe-transition);
}
.wpe-cat-tag:hover { background: var(--wpe-accent); border-color: var(--wpe-accent); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   BOUTONS
══════════════════════════════════════════════════════════════ */
.wpe-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 700; text-decoration: none;
  transition: all var(--wpe-transition); white-space: nowrap;
}
.wpe-btn--primary {
  background: var(--wpe-accent); color: #fff;
}
.wpe-btn--primary:hover { background: var(--wpe-accent-h); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52,152,219,.35); }
.wpe-btn--disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.wpe-btn--sm { padding: 7px 16px; font-size: 13px; font-weight: 600; background: var(--wpe-bg); border: 1px solid var(--wpe-border); color: var(--wpe-text); border-radius: 6px; }
.wpe-btn--sm:hover { background: var(--wpe-accent); border-color: var(--wpe-accent); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   ARCHIVE — TOOLBAR (switcher grille/liste)
══════════════════════════════════════════════════════════════ */
.wpe-events-container { max-width: 1200px; margin: 0 auto; }

.wpe-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; padding-bottom: 16px;
  border-bottom: 1px solid var(--wpe-border);
}
.wpe-total-count {
  font-size: 14px; color: var(--wpe-muted); font-weight: 500;
}

/* Switcher */
.wpe-view-switcher {
  display: inline-flex; gap: 4px;
  background: var(--wpe-bg); border: 1px solid var(--wpe-border);
  border-radius: 8px; padding: 4px;
}
.wpe-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border: none; border-radius: 6px;
  background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--wpe-muted);
  transition: all var(--wpe-transition);
}
.wpe-view-btn:hover { color: var(--wpe-text); }
.wpe-view-btn.is-active {
  background: #fff; color: var(--wpe-accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.10); font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   ARCHIVE — GRILLE
══════════════════════════════════════════════════════════════ */
.wpe-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}
.wpe-grid--cols-1 { grid-template-columns: 1fr; }
.wpe-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.wpe-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.wpe-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .wpe-grid--cols-4 { grid-template-columns: repeat(3, 1fr); }
  .wpe-grid--cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wpe-grid { grid-template-columns: 1fr !important; }
}

/* ── Carte grille ───────────────────────────────────────────── */
.wpe-card {
  background: #fff; border: 1px solid var(--wpe-border);
  border-radius: var(--wpe-radius); overflow: hidden;
  box-shadow: var(--wpe-shadow);
  transition: transform var(--wpe-transition), box-shadow var(--wpe-transition);
  display: flex; flex-direction: column;
}
.wpe-card:hover { transform: translateY(-4px); box-shadow: var(--wpe-shadow-h); }

.wpe-card__image-wrap {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 16/9; background: var(--wpe-bg); text-decoration: none;
}
.wpe-card__image-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.wpe-card:hover .wpe-card__image-wrap img { transform: scale(1.03); }

.wpe-card__image-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
}
.wpe-card__image-placeholder svg { width: 100%; height: 100%; }

.wpe-card__badge {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; white-space: nowrap;
  backdrop-filter: blur(4px);
}
/* Couleurs badge sur image */
.wpe-card__badge.wpe-statut-badge--planifie { background: rgba(239,246,255,.92); color: var(--wpe-planifie-c); }
.wpe-card__badge.wpe-statut-badge--ouvert   { background: rgba(240,253,244,.92); color: var(--wpe-ouvert-c); }
.wpe-card__badge.wpe-statut-badge--complet  { background: rgba(254,242,242,.92); color: var(--wpe-complet-c); }
.wpe-card__badge.wpe-statut-badge--annule   { background: rgba(243,244,246,.92); color: var(--wpe-annule-c); }
.wpe-card__badge.wpe-statut-badge--termine  { background: rgba(255,251,235,.92); color: var(--wpe-termine-c); }

.wpe-card__body {
  padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.wpe-card__date {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--wpe-muted); font-weight: 500;
}
.wpe-card__date svg { flex-shrink: 0; color: var(--wpe-accent); }
.wpe-card__lieu { color: var(--wpe-muted); }

.wpe-card__title { font-size: 16px; font-weight: 700; color: var(--wpe-text); margin: 0; line-height: 1.3; }
.wpe-card__title a { text-decoration: none; color: inherit; }
.wpe-card__title a:hover { color: var(--wpe-accent); }

.wpe-card__cats { display: flex; flex-wrap: wrap; gap: 4px; }
.wpe-card__cat {
  font-size: 11px; color: var(--wpe-muted); background: var(--wpe-bg);
  padding: 2px 8px; border-radius: 4px; font-weight: 500;
}

.wpe-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--wpe-border);
}
.wpe-card__prix { font-size: 18px; font-weight: 800; color: var(--wpe-text); }
.wpe-card__prix--free { color: var(--wpe-ouvert-c); }

.wpe-card__cta {
  display: flex; align-items: center; gap: 6px; margin-top: 12px;
  font-size: 14px; font-weight: 700; color: var(--wpe-accent);
  text-decoration: none; transition: gap var(--wpe-transition);
}
.wpe-card__cta:hover { gap: 10px; color: var(--wpe-accent-h); }
.wpe-card__cta svg { transition: transform var(--wpe-transition); }
.wpe-card__cta:hover svg { transform: translateX(3px); }

/* ══════════════════════════════════════════════════════════════
   ARCHIVE — LISTE
══════════════════════════════════════════════════════════════ */
.wpe-list { display: flex; flex-direction: column; gap: 12px; }

.wpe-list-item {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid var(--wpe-border);
  border-radius: var(--wpe-radius); padding: 16px 20px;
  box-shadow: var(--wpe-shadow);
  transition: transform var(--wpe-transition), box-shadow var(--wpe-transition);
}
.wpe-list-item:hover { transform: translateX(4px); box-shadow: var(--wpe-shadow-h); }

/* Vignette date */
.wpe-list-item__date-thumb {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 52px; height: 52px; border-radius: 10px;
  background: var(--wpe-accent); color: #fff; flex-shrink: 0;
}
.wpe-list-item__date-day   { font-size: 20px; font-weight: 800; line-height: 1; }
.wpe-list-item__date-month { font-size: 11px; font-weight: 600; text-transform: uppercase; opacity: .85; }

/* Miniature image */
.wpe-list-item__thumb { display: block; flex-shrink: 0; width: 72px; height: 54px; border-radius: 8px; overflow: hidden; text-decoration: none; }
.wpe-list-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.wpe-list-item__thumb-placeholder { width: 100%; height: 100%; background: var(--wpe-bg); border: 1px solid var(--wpe-border); border-radius: 8px; }

/* Corps */
.wpe-list-item__body { flex: 1; min-width: 0; }
.wpe-list-item__title { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: var(--wpe-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpe-list-item__title a { text-decoration: none; color: inherit; }
.wpe-list-item__title a:hover { color: var(--wpe-accent); }
.wpe-list-item__date-info { font-size: 12px; color: var(--wpe-muted); margin-bottom: 4px; }
.wpe-list-item__cats { display: flex; flex-wrap: wrap; gap: 4px; }
.wpe-list-item__cat { font-size: 11px; background: var(--wpe-bg); color: var(--wpe-muted); padding: 1px 7px; border-radius: 4px; }

/* Méta droite */
.wpe-list-item__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.wpe-list-item__prix { font-size: 17px; font-weight: 800; color: var(--wpe-text); }
.wpe-list-item__prix--free { color: var(--wpe-ouvert-c); }

@media (max-width: 640px) {
  .wpe-list-item { flex-wrap: wrap; }
  .wpe-list-item__meta { flex-direction: row; width: 100%; justify-content: flex-start; }
}

/* ══════════════════════════════════════════════════════════════
   SINGLE — PAGE ÉVÉNEMENT (style page produit WooCommerce)
══════════════════════════════════════════════════════════════ */
.wpe-single-wrap {
  max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px;
}

/* Breadcrumb */
.wpe-breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--wpe-muted); margin-bottom: 28px;
}
.wpe-breadcrumb a { color: var(--wpe-muted); text-decoration: none; }
.wpe-breadcrumb a:hover { color: var(--wpe-accent); }
.wpe-breadcrumb__sep { opacity: .5; }

/* Layout 2 colonnes */
.wpe-single-product {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  align-items: start; margin-bottom: 56px;
}
@media (max-width: 768px) {
  .wpe-single-product { grid-template-columns: 1fr; gap: 28px; }
}

/* Galerie image */
.wpe-single-product__gallery {}
.wpe-single-product__main-image {
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  aspect-ratio: 4/3; background: var(--wpe-bg);
}
.wpe-single-product__main-image img,
.wpe-product-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.wpe-single-product__no-image {
  display: flex; align-items: center; justify-content: center;
}
.wpe-single-product__no-image svg { width: 100%; height: auto; }

/* Summary */
.wpe-single-product__summary { display: flex; flex-direction: column; gap: 16px; }
.wpe-single-product__cats { display: flex; flex-wrap: wrap; gap: 6px; }
.wpe-single-product__title { font-size: clamp(22px, 4vw, 32px); font-weight: 800; line-height: 1.2; margin: 0; color: var(--wpe-text); }

/* Méta infos */
.wpe-single-product__meta-block { display: flex; flex-direction: column; gap: 8px; }
.wpe-meta-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--wpe-muted);
}
.wpe-meta-row__icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--wpe-accent); }

/* Divider */
.wpe-divider { border: none; border-top: 1px solid var(--wpe-border); margin: 4px 0; }

/* Prix */
.wpe-single-product__price { display: flex; align-items: baseline; gap: 4px; }
.wpe-price-amount { font-size: 36px; font-weight: 800; color: var(--wpe-text); }
.wpe-price-amount sup { font-size: 18px; font-weight: 700; vertical-align: super; }
.wpe-price-free { font-size: 28px; font-weight: 800; color: var(--wpe-ouvert-c); }

/* CTA */
.wpe-single-product__cta { margin-top: 4px; }
.wpe-single-product__cta .wpe-btn--primary { width: 100%; font-size: 16px; padding: 15px 24px; border-radius: 10px; }
.wpe-cta-msg { font-size: 14px; color: var(--wpe-muted); padding: 12px 16px; background: var(--wpe-bg); border-radius: 8px; border: 1px solid var(--wpe-border); }
.wpe-cta-msg--annule, .wpe-cta-msg--termine { color: var(--wpe-annule-c); }

/* Référence */
.wpe-single-product__ref { font-size: 12px; color: #c0c9d4; }
.wpe-single-product__ref span { font-weight: 600; }

/* ── Onglets ────────────────────────────────────────────────── */
.wpe-tabs-wrap { border-top: 1px solid var(--wpe-border); }
.wpe-tabs-nav {
  display: flex; gap: 0; margin-bottom: 0;
  border-bottom: 1px solid var(--wpe-border);
}
.wpe-tab {
  padding: 14px 24px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--wpe-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--wpe-transition);
}
.wpe-tab:hover { color: var(--wpe-text); }
.wpe-tab.is-active { color: var(--wpe-accent); border-bottom-color: var(--wpe-accent); }

.wpe-tab-panel { display: none; padding: 36px 0; }
.wpe-tab-panel.is-active { display: block; }
.wpe-description { line-height: 1.8; font-size: 15px; color: var(--wpe-text); max-width: 760px; }

/* Dates cards */
.wpe-dates-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wpe-date-card {
  background: #fff; border: 1px solid var(--wpe-border);
  border-radius: 10px; padding: 18px 20px;
  position: relative; transition: box-shadow var(--wpe-transition);
}
.wpe-date-card:hover { box-shadow: var(--wpe-shadow); }
.wpe-date-card--highlight { border-color: var(--wpe-accent); box-shadow: 0 0 0 3px rgba(52,152,219,.10); }
.wpe-date-card__tag {
  position: absolute; top: -10px; left: 16px;
  background: var(--wpe-accent); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 10px; border-radius: 20px;
}
.wpe-date-card__date, .wpe-date-card__lieu {
  display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--wpe-text);
  margin-bottom: 8px;
}
.wpe-date-card__date svg, .wpe-date-card__lieu svg {
  width: 14px; height: 14px; flex-shrink: 0; color: var(--wpe-accent);
}
.wpe-date-card__lieu { color: var(--wpe-muted); }
.wpe-date-card__note { font-size: 12px; color: var(--wpe-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   CAPACITÉ (barre de progression)
══════════════════════════════════════════════════════════════ */
.wpe-capacity { margin: 4px 0; }
.wpe-capacity__bar {
  height: 6px; background: var(--wpe-border);
  border-radius: 99px; overflow: hidden; margin-bottom: 4px;
}
.wpe-capacity__fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.wpe-capacity__fill--low    { background: var(--wpe-ouvert-c); }
.wpe-capacity__fill--medium { background: #f59e0b; }
.wpe-capacity__fill--high   { background: var(--wpe-complet-c); }
.wpe-capacity__text { font-size: 12px; color: var(--wpe-muted); }

/* ══════════════════════════════════════════════════════════════
   ÉTAT VIDE
══════════════════════════════════════════════════════════════ */
.wpe-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; gap: 16px; color: var(--wpe-muted); text-align: center;
}
.wpe-empty-state svg { opacity: .3; }
.wpe-empty-state p { font-size: 16px; margin: 0; }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════════ */
.wpe-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 48px; flex-wrap: wrap; }
.wpe-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--wpe-border); border-radius: 8px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--wpe-text);
  background: #fff; transition: all var(--wpe-transition);
}
.wpe-pagination .page-numbers:hover { background: var(--wpe-accent); border-color: var(--wpe-accent); color: #fff; }
.wpe-pagination .page-numbers.current { background: var(--wpe-accent); border-color: var(--wpe-accent); color: #fff; }
