/*
 * /sorties/:id — one event set like a letter's particulars: the facts as a
 * list whose labels (Quand, Où, Prix, Liens; When, Where…) sit in the margin column, as
 * « Objet : » does on the home letter; then the picture, the source's
 * description and the open-data attribution as a closing note.
 */

.event {
  padding-top: var(--space-12);
}

.event-back {
  grid-column: margin;
  grid-row: 1;
  justify-self: end;
  align-self: baseline;
  font-size: var(--cj-small);
}
/* inline-block with some padding: a tap target at least 24px tall (WCAG 2.5.8). */
.event-back-link {
  display: inline-block;
  padding-block: var(--space-1);
  color: var(--ink-muted);
  text-decoration-color: transparent;
  white-space: nowrap;
}
.event-back-link:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.event-title {
  grid-column: text-start / full-end;
  grid-row: 1;
  align-self: baseline;
  font-size: var(--cj-heading);
  font-style: italic;
  overflow-wrap: anywhere;
}

/* « C'est passé. » pressed into the margin like a postmark. */
.event-past {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  margin-top: var(--space-8);
  color: var(--ink-secondary);
  text-wrap: pretty;
}
.event-past-stamp {
  grid-column: margin;
  justify-self: end;
  padding: var(--space-1) var(--space-2);
  border: var(--border-width-2) solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  color: var(--accent);
  rotate: -4deg;
}
.event-past-text {
  grid-column: text;
}

.event-facts {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: var(--space-5);
  margin: var(--space-10) 0 0;
}

.event-fact {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
}

.event-fact-label {
  grid-column: margin;
  justify-self: end;
  font-size: var(--cj-small);
  font-style: italic;
  color: var(--ink-muted);
}

.event-fact-value {
  grid-column: text;
  margin: 0;
}

.event-dates {
  margin: 0;
  padding: 0;
  list-style: none;
}
.event-more-dates {
  font-style: italic;
  color: var(--ink-muted);
}

.event-address {
  font-style: normal;
  line-height: var(--line-height-normal);
}
.event-venue {
  font-weight: var(--font-weight-semibold);
}

.event-distance {
  margin-top: var(--space-1);
  font-size: var(--cj-small);
  font-style: italic;
  color: var(--ink-muted);
}

.event-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

/*
 * The source's picture, mounted on a paper passe-partout. The feeds give no
 * image dimensions, so no width/height attributes can reserve its space:
 * the mount does, a 4:3 frame laid out before the picture arrives (no layout
 * shift), the picture centred inside at its own shape, never enlarged. The
 * frame keeps to the reading column, as wide as the text around it.
 */
.event-figure {
  grid-column: text;
  width: min(100%, calc(var(--cj-figure-max) * 4 / 3));
  margin: var(--space-10) 0 0;
}
.event-frame {
  aspect-ratio: 4 / 3;
  padding: var(--space-2);
  background: var(--paper-soft);
  border: var(--border-width-1) solid var(--line);
}
.event-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: scale-down;
}
.event-credit {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  font-style: italic;
  color: var(--ink-muted);
}

.event-description {
  margin-top: var(--space-10);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.event-description p + p { margin-top: 1em; }

/* English edition: the source's French description, introduced as such. */
.event-description-note {
  margin-top: var(--space-10);
  font-size: var(--cj-small);
  font-style: italic;
  color: var(--ink-muted);
}
.event-description-note + .event-description { margin-top: var(--space-3); }

.event-source {
  margin-top: var(--space-12);
  padding-top: var(--space-4);
  border-top: var(--border-width-1) solid var(--line);
  font-size: var(--font-size-sm);
  color: var(--ink-muted);
  text-wrap: pretty;
}
.event-source time { white-space: nowrap; }

@media (max-width: 47.99em) {
  .event { padding-top: var(--space-8); }
  .event-back,
  .event-title { grid-row: auto; }
  .event-back { justify-self: start; margin-bottom: var(--space-3); }
  .event-title { grid-column: text; }
  .event-description { hyphens: auto; }

  .event-past { display: block; }
  .event-past-stamp { display: inline-block; margin-right: var(--space-2); }

  .event-facts { row-gap: var(--space-4); }
  .event-fact-label { justify-self: start; }
}
