/* ==========================================================================
   cards.css — eHaj Design System
   Cards, summary blocks, timeline of Hajj steps, accordion, simple modal.
   Requires base.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Carte générique
   -------------------------------------------------------------------------- */

.eh-card {
  background: var(--eh-white);
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius);
  box-shadow: var(--eh-shadow-sm);
  overflow: hidden;
}

.eh-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--eh-space-3);
  padding: var(--eh-space-4) var(--eh-space-5);
  border-bottom: 1px solid var(--eh-border);
}

.eh-card-title {
  margin: 0;
  color: var(--eh-green-900);
  font-size: 1.02rem;
  font-weight: 700;
}

.eh-card-subtitle {
  margin: 0.15rem 0 0;
  color: var(--eh-text-muted);
  font-size: 0.82rem;
}

.eh-card-body {
  padding: var(--eh-space-5);
}

.eh-card-body > *:last-child {
  margin-bottom: 0;
}

.eh-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: var(--eh-space-4) var(--eh-space-5);
  background: var(--eh-bg-soft);
  border-top: 1px solid var(--eh-border);
}

.eh-card.eh-card-accent {
  border-top: 3px solid var(--eh-gold);
}

/* --------------------------------------------------------------------------
   Bloc résumé (ex : résumé d'une structure, d'un dossier pèlerin)
   -------------------------------------------------------------------------- */

.eh-summary {
  padding: var(--eh-space-5);
  background: linear-gradient(165deg, var(--eh-green-900), var(--eh-green-700));
  color: var(--eh-white);
  border-radius: var(--eh-radius);
}

.eh-summary dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: var(--eh-space-4) 0 0;
}

.eh-summary dt {
  color: rgba(244, 241, 232, 0.6);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.eh-summary dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Timeline — étapes du Hajj
   -------------------------------------------------------------------------- */

.eh-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: eh-step;
}

.eh-timeline-item {
  position: relative;
  padding: 0 0 var(--eh-space-5) 2.5rem;
  counter-increment: eh-step;
}

.eh-timeline-item::before {
  content: counter(eh-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--eh-green-700);
  color: var(--eh-gold-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.eh-timeline-item::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 1.7rem;
  bottom: 0;
  width: 2px;
  background: var(--eh-border-strong);
}

.eh-timeline-item:last-child::after {
  display: none;
}

.eh-timeline-item.is-done::before {
  background: var(--eh-success);
  color: var(--eh-white);
}

.eh-timeline-item.is-done::after {
  background: var(--eh-success);
}

.eh-timeline-item.is-current::before {
  background: var(--eh-gold);
  color: #201703;
  box-shadow: 0 0 0 4px var(--eh-gold-100);
}

.eh-timeline-item h4 {
  margin: 0 0 0.2rem;
}

.eh-timeline-item p {
  margin: 0;
  color: var(--eh-text-muted);
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Accordéon simple (natif, sans JavaScript)
   -------------------------------------------------------------------------- */

.eh-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.eh-accordion details {
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius-sm);
  background: var(--eh-white);
  overflow: hidden;
}

.eh-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  color: var(--eh-green-900);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.eh-accordion summary::-webkit-details-marker {
  display: none;
}

.eh-accordion summary::after {
  content: "+";
  color: var(--eh-gold-700);
  font-size: 1.1rem;
  font-weight: 700;
}

.eh-accordion details[open] summary::after {
  content: "−";
}

.eh-accordion details[open] summary {
  border-bottom: 1px solid var(--eh-border);
}

.eh-accordion .eh-accordion-body {
  padding: 1rem;
  color: var(--eh-text-soft);
}

/* --------------------------------------------------------------------------
   Modale simple (élément natif <dialog>)
   Ouverture/fermeture : dialogEl.showModal() / .close() — un utilitaire JS
   minimal (quelques lignes) est nécessaire ; voir templates d'exemple.
   -------------------------------------------------------------------------- */

.eh-modal {
  width: min(560px, calc(100vw - 2.5rem));
  padding: 0;
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius-lg);
  box-shadow: var(--eh-shadow-lg);
}

.eh-modal::backdrop {
  background: rgba(10, 20, 18, 0.55);
  backdrop-filter: blur(2px);
}

.eh-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--eh-space-3);
  padding: var(--eh-space-5);
  border-bottom: 1px solid var(--eh-border);
}

.eh-modal-header h3 {
  margin: 0;
}

.eh-modal-close {
  border: 0;
  background: transparent;
  color: var(--eh-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.eh-modal-body {
  padding: var(--eh-space-5);
}

.eh-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: var(--eh-space-4) var(--eh-space-5);
  border-top: 1px solid var(--eh-border);
  background: var(--eh-bg-soft);
}
