.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.loading {
  padding: 2rem;
  text-align: center;
  font-weight: 500;
  color: #555;
}


.filters select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  height: 36px;
  font-size: 14px;
  
  width: auto;
  min-width: 180px; /* optional, tweak to taste */
  flex: 0 0 auto;
}

.filters select:last-child {
  margin-left: auto;
}

.month h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 8px;
  text-transform: none;
}

.event {
  padding: 12px 0;
  border-bottom: 1px solid #e3e3e3;
  font-size: 14px;
}

.event strong {
  font-weight: 600;
}

.event-left {
  display: flex;
  gap: 16px;
}

.event-date {
  min-width: 80px;
}

.event-location {
  font-size: 0.9em;
  color: #666;
}

.event button {
  border: 1px solid #4f6ef7;
  background: white;
  color: #4f6ef7;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: not-allowed;
}

.grid {
  display: grid;
  grid-template-columns:
    minmax(120px, 0.9fr)   /* date manifestation */
    minmax(140px, 1fr)     /* date inscription */
    minmax(280px, 3fr)     /* libellé (dominant) */
    minmax(180px, 1.5fr)   /* lieu */
    minmax(220px, 1.5fr)   /* discipline */
    minmax(120px, max-content); /* button */
  column-gap: 24px;
  align-items: center;
}

#manifestations-root {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 24px;
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
}

.month-header {
  font-size: 12px;
  font-weight: 500;
  color: #6b6b6b;
  padding: 8px 0 10px;
  border-bottom: 1px solid #cfcfcf;
}

.event > div,
.month-header > div {
  line-height: 1.3;
}

.event > div:nth-child(3) strong {
  font-size: 15px;
}

.elementor-widget-shortcode {
  width: 100%;
}

.elementor-widget-shortcode #manifestations-root {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  max-width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 0 64px;
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
}

.details-btn {
  display: inline-block;
  border: 1px solid #2F4999;
  background: white;
  color: #2F4999;
  border-radius: 6px;
  padding: 6px 14px;
  text-decoration: none;
  font-size: 14px;
}

.details-btn:hover {
  background: #f4f7ff;
}

.competition-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  margin-right: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.competition-square-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  margin-right: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.detail-competition {
  margin-top: 24px;
}

.detail-back {
  margin-bottom: 16px;
  font-size: 14px;
}

.detail-back a {
  text-decoration: none;
  color: #000;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.detail-side .card {
  padding: 14px;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.card h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.epreuves-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.epreuves-table th,
.epreuves-table td {
  padding: 10px 0;
  font-size: 14px;
  text-align: left;
  vertical-align: middle;
}

.epreuves-table thead th {
  font-weight: 500;
  color: #6b6b6b;
  border-bottom: 1px solid #eee;
}

.epreuves-table th:nth-child(1),
.epreuves-table td:nth-child(1) {
  width: 50%;
}

.epreuves-table th:nth-child(2),
.epreuves-table td:nth-child(2) {
  width: 30%;
}

.epreuves-table th:nth-child(3),
.epreuves-table td:nth-child(3) {
  width: 20%;
  text-align: right;
}

.epreuves-table td.tarif,
.epreuves-table th.tarif {
  text-align: right;
}

#competition-map {
  width: 100%;
  height: 300px;
  border-radius: 10px;
  margin: 8px 0 12px;
}

.location-text {
  font-size: 14px;
  text-align: center;  
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 16px;
  height: 16px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
}

.section-title.info::before {
  background-image: url("data:image/svg+xml,%3Csvg ... %3C/svg%3E");
}

.section-title.list::before {
  background-image: url("data:image/svg+xml,%3Csvg ... %3C/svg%3E");
}

.section-title.location::before {
  background-image: url("data:image/svg+xml,%3Csvg ... %3C/svg%3E");
}

.info-grid {
  grid-template-columns: 1.2fr 1fr;
}

.info-grid strong {
  color: #2F4999;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.no-results {
  padding: 2rem;
  text-align: center;
  font-weight: 500;
  color: #666;
}

.event-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111;
}

/* =========================
   MANIFESTATIONS — MOBILE FIX
   Append this at end of file
========================= */
@media (max-width: 768px) {
  /* Remove the desktop full-bleed gutters */
  #manifestations-root {
    padding: 16px 12px;
  }

  .elementor-widget-shortcode #manifestations-root {
    width: 100%;
    max-width: 100%;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    padding: 16px 12px; /* key: replaces 64px */
  }

  /* Filters: stack, full width */
  #manifestations-root .filters {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
  }
  #manifestations-root .filters select {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }
  #manifestations-root .filters select:last-child {
    margin-left: 0; /* undo desktop push-right */
  }

  /* Header row doesn't fit on mobile */
  #manifestations-root .month-header.grid {
    display: none;
  }

  /* Turn each event row into a stacked card */
  #manifestations-root .event.grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 6px;
    padding: 12px 0;              /* no side padding => separator spans full width */
    border-bottom: 1px solid #000; /* full-width separator */
  }

  /* Make long text wrap instead of forcing overflow */
  #manifestations-root .event > div,
  #manifestations-root .event-title {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Put the button left (or keep right if you prefer) */
  #manifestations-root .details-btn {
    justify-self: start;
  }
}

/* Smaller phones */
@media (max-width: 420px) {
  .elementor-widget-shortcode #manifestations-root {
    padding: 12px 10px;
  }
}

/* =========================
   DETAIL PAGE — MOBILE FIX
   Append at end of file
========================= */
@media (max-width: 900px) {
  /* global padding: same problem as list page */
  .elementor-widget-shortcode #manifestations-root {
    width: 100%;
    max-width: 100%;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    padding: 16px 12px;
  }

  /* detail wrapper spacing */
  .detail-competition {
    margin-top: 16px;
  }

  /* 2-column -> 1-column */
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* cards: reduce padding */
  .card {
    padding: 14px 14px;
  }

  /* pills: allow wrapping instead of overflowing */
  .competition-pill,
  .competition-square-pill {
    white-space: normal;
    max-width: 100%;
  }

  /* info grid: 2 columns -> 1 column */
  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* table: make it horizontally scrollable on small screens */
  .epreuves-table {
    table-layout: auto; /* stop fixed squeezing */
    min-width: 560px;   /* forces scroll instead of breaking layout */
  }

  /* wrap the table inside a scroll container */
  .epreuves-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .epreuves-table thead,
  .epreuves-table tbody,
  .epreuves-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  /* map: smaller height on mobile */
  #competition-map {
    height: 220px;
  }

  /* location text: prevent overflow */
  .location-text {
    padding: 0 8px;
    overflow-wrap: anywhere;
  }
}

/* very small phones */
@media (max-width: 420px) {
  #competition-map {
    height: 200px;
  }

  .details-btn {
    width: 100%;
    text-align: center;
    padding: 10px 14px;
  }
}

/* =========================
   STOP RIGHT OVERFLOW (GLOBAL)
========================= */

/* critical: remove 100vw full-bleed on small screens */
@media (max-width: 900px) {
  .elementor-widget-shortcode #manifestations-root {
    position: static;      /* cancels the left:50% trick */
    left: auto;
    right: auto;

    width: 100%;           /* NOT 100vw */
    max-width: 100%;

    margin-left: 0;
    margin-right: 0;

    padding-left: 12px;    /* mobile gutters */
    padding-right: 12px;

    overflow-x: clip;      /* prevent child bleed (better than hidden) */
  }
}

/* =========================
   CALENDAR — TABLET H-SCROLL
========================= */
@media (max-width: 1024px) {
  /* container that should scroll (pick the real root) */
  #calendar-root,
  .calendar-root,
  .calendar-wrapper,
  .elementor-widget-shortcode {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* the element that currently overflows (grid/table) */
  #calendar-root .grid,
  #calendar-root table,
  .calendar-root .grid,
  .calendar-root table {
    min-width: 980px; /* force scroll instead of squishing/overflowing */
  }
}

@media (max-width: 1024px) {
  #calendar-root {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #calendar-root > * {
    min-width: 980px;
  }
}