/* Calendrier des evenements (templates/eventcalendar/events_calendar.html).
   Cases sobres : bloc date a gauche, fine bordure sable, une couleur d'accent par famille
   d'evenements (accordee au dore du site). Une colonne sur telephone. */

.cal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  color: var(--gris-marque, #4a4a4a);
  font-size: 16px;
  --sable: #e4d8c4;
  --dore: #ba9966;
  --dore-fonce: #8a6a2f;
  --accent: var(--dore);
}

/* En-tete et periode */
.cal-head {
  text-align: center;
  margin: 1rem 0 1.25rem;
}

.cal-head__title {
  font-size: 1.9rem;
  color: var(--dore);
  margin-bottom: 0.4rem;
}

.cal-head__intro {
  color: #666;
  margin-bottom: 1rem;
}

.cal-period {
  display: inline-flex;
  border: 1px solid var(--dore);
  border-radius: 999px;
  overflow: hidden;
}

.cal-period__link {
  padding: 0.4rem 1.1rem;
  color: #6b5532;
  text-decoration: none;
}

.cal-period__link.is-active {
  background: var(--dore);
  color: #fff;
}

/* Mini-carte (fond static/img/world-map.svg) */
.cal-map {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 1000 / 394;
  margin: 0 auto 1rem;
}

.cal-map__dot {
  fill: var(--dore);
  stroke: #fff;
  stroke-width: 2;
}

.cal-map__halo {
  fill: var(--dore);
  opacity: 0.25;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.2s, transform 0.2s;
}

.cal-map__point--listings .cal-map__dot,
.cal-map__point--listings .cal-map__halo {
  fill: var(--dore-fonce);
}

.cal-map__point:hover .cal-map__halo,
.cal-map__point:focus .cal-map__halo {
  opacity: 0.5;
  transform: scale(1.4);
}

/* Filtres */
.cal-filters {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.cal-filters__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.cal-search input,
.cal-country select {
  height: 2.4rem;
  padding: 0 0.9rem;
  border: 1px solid var(--sable);
  border-radius: 999px;
  background: #fff;
  color: inherit;
  font-size: 0.95rem;
}

.cal-search input {
  width: 18rem;
  max-width: 100%;
}

.cal-search input:focus,
.cal-country select:focus {
  outline: 2px solid var(--dore);
  outline-offset: 1px;
}

.cal-submit {
  height: 2.4rem;
  padding: 0 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--dore);
  color: #fff;
}

.cal-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.cal-chip {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--dore);
  border-radius: 999px;
  background: #fff;
  color: #6b5532;
  font-size: 0.88rem;
  cursor: pointer;
}

.cal-chip:hover,
.cal-chip:focus-visible {
  background: #f3ebde;
}

.cal-chip.is-active {
  background: var(--dore);
  color: #fff;
}

.cal-chip__count {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 0.2rem;
  padding: 0 0.35em;
  border-radius: 999px;
  background: rgba(186, 153, 102, 0.18);
  font-size: 0.8em;
}

.cal-chip.is-active .cal-chip__count {
  background: rgba(255, 255, 255, 0.3);
}

.cal-chips--zones .cal-chip {
  border-style: dashed;
}

.cal-count {
  text-align: center;
  color: #666;
  margin: 0.5rem 0 1rem;
}

/* Mois et cases */
.cal-month {
  margin-bottom: 1.5rem;
}

.cal-month__title {
  font-size: 1.15rem;
  text-transform: capitalize;
  color: var(--dore-fonce);
  border-bottom: 1px solid var(--sable);
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
}

.cal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.8rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-direction: unset;
  align-items: stretch;
}

.cal-card {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--sable);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  scroll-margin-top: 1rem;
}

.cal-card:target {
  box-shadow: 0 0 0 3px rgba(186, 153, 102, 0.45);
}

/* Familles d'evenements */
.cal-card--festive { --accent: #c9864a; }
.cal-card--lights { --accent: #b8a04a; }
.cal-card--newyear { --accent: #8f7bb3; }
.cal-card--national { --accent: #5f8a9e; }
.cal-card--irish { --accent: #6f9a6a; }
.cal-card--motor { --accent: #a65d4e; }

.cal-date {
  flex: 0 0 3.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 4.2rem;
  border-radius: 6px;
  background: #faf6ef;
  line-height: 1.1;
}

.cal-date__day {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
}

.cal-date__month {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.cal-date__year {
  font-size: 0.7rem;
  color: #888;
}

.cal-card__body {
  flex: 1;
  min-width: 0;
}

.cal-card__title {
  font-size: 1.02rem;
  font-weight: bold;
  margin: 0 0 0.2rem;
  overflow-wrap: anywhere;
}

.cal-card__place {
  margin: 0 0 0.4rem;
  color: #666;
  font-size: 0.9rem;
}

.cal-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}

.cal-pill {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, #fff);
  color: #4a3a22;
}

.cal-card__when {
  color: #555;
}

.cal-badge {
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  background: #fff3d6;
  color: #7a5a14;
  font-weight: bold;
}

.cal-badge--now {
  background: #e3f2e1;
  color: #2f6b2f;
}

.cal-badge--estimated {
  background: transparent;
  border: 1px dashed #b9a06a;
  color: #6b5a33;
  font-weight: normal;
}

/* Edition deduite des annonces publiees (eventcalendar/associations.py : listing_editions) */
.cal-badge--listings {
  background: #f1ebe0;
  color: #5c4a25;
  font-weight: normal;
}

.cal-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  margin: 0;
}

.cal-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--dore);
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
}

.cal-btn:hover {
  background: var(--dore-fonce);
  color: #fff;
}

.cal-btn--ghost {
  background: #fff;
  border: 1px solid var(--dore);
  color: #6b5532;
}

.cal-btn--ghost:hover {
  background: #f3ebde;
  color: #6b5532;
}

.cal-link {
  font-size: 0.82rem;
  color: #6b5532;
}

.cal-empty {
  text-align: center;
  color: #666;
}

.cal .is-hidden {
  display: none;
}

/* Telephone : une colonne, pastilles defilant a l'horizontale */
@media screen and (max-width: 600px) {
  .cal-list {
    grid-template-columns: 1fr;
  }

  .cal-chips {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
  }

  .cal-chip {
    flex: 0 0 auto;
  }

  .cal-search input {
    width: 100%;
  }

  .cal-filters__row > label {
    flex: 1 1 100%;
  }

  .cal-country select {
    width: 100%;
  }
}
