/* ==========================================================================
   Almureed Events (almureed-events.php): the events list and event categories.
   Colours and the .alm-c container come from components.css.
   ========================================================================== */

.alm-evwrap,
.alm-events,
.alm-events *,
.alm-evcta { box-sizing: border-box; }

.alm-evwrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(48px, 6vw, 88px);
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding: clamp(48px, 6vw, 88px) 20px clamp(56px, 7vw, 104px);
}
.alm-events { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(56px, 7cqi, 96px); }
.alm-events__section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }

/* The theme gives list items a bottom margin; these lists space themselves with gap. */
.alm-c ul.alm-elist > li,
.alm-c ul.alm-ecard__meta > li { margin: 0; }

/* --------------------------------------------------------------------------
   Event card: date tile, then the text, then (wide cards with a photo) the image.
   ----------------------------------------------------------------------- */
.alm-elist { display: grid; gap: 20px; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0; list-style: none; }
.alm-ecard {
  position: relative;
  container: ecard / inline-size;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  column-gap: 24px;
  row-gap: 12px;
  align-items: start;
  padding: 20px 24px 20px 20px;
  background: #FFFFFF;
  border: 1px solid var(--alm-line);
  border-radius: 28px;
  color: var(--alm-ink);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.alm-ecard > :is(header, p) { grid-column: 2; }
.alm-ecard__date {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  width: 88px;
  min-height: 104px;
  padding: 12px 6px 10px;
  border-radius: 44px 44px 16px 16px;
  background: #EEF3D0;
  color: var(--alm-green);
  text-align: center;
  line-height: 1;
}
.alm-ecard__day {
  font-family: var(--heading-font-family, "Gallery", serif);
  font-size: 2.25rem;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "calt" 0, "swsh" 0;
  line-height: 1;
}
.alm-ecard__month { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.alm-ecard__year { color: var(--alm-body); font-size: 0.75rem; font-weight: 600; }
.alm-ecard > header { display: grid; gap: 8px; padding-top: 4px; }
.alm-ecard__cat { margin: 0; color: var(--alm-green); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.3; text-transform: uppercase; }
.alm-c .alm-ecard__title {
  margin: 0;
  color: inherit;
  font-family: var(--heading-font-family, "Gallery", serif);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: 0;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "calt" 0, "swsh" 0;
  text-wrap: balance;
}
.alm-ecard__title a { color: inherit; text-decoration: none; }
.alm-ecard__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--alm-body); font-size: 0.9375rem; line-height: 1.4; }
.alm-ecard__meta li { display: inline-flex; align-items: center; gap: 6px; }
.alm-ecard__meta svg { flex: none; color: var(--alm-green); }
.alm-ecard__text { margin: 0; color: var(--alm-body); font-size: 0.9375rem; line-height: 1.65; text-wrap: pretty; }
.alm-c .alm-ecard > img {
  display: block;
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
}
.alm-ecard--media > .alm-ecard__date { grid-row: 2 / span 2; }

/* Wide cards with a photo: the photo sits at the right. */
@container ecard (min-width: 680px) {
  .alm-ecard--media > .alm-ecard__date { grid-row: 1 / span 2; }
  /* Size containment drops the photo's own height from the row sizing: the text sets the card's height and the photo fills it. */
  .alm-c .alm-ecard--media > img { grid-column: 3; grid-row: 1 / span 2; align-self: stretch; width: 240px; height: auto; min-height: 150px; aspect-ratio: auto; contain: size; }
}
.alm-ecard--media { grid-template-columns: 88px minmax(0, 1fr) auto; }

/* Narrow cards: a smaller date tile leaves the title more room. */
@container ecard (max-width: 439.98px) {
  .alm-ecard__date { width: 64px; min-height: 80px; padding: 10px 4px 8px; border-radius: 32px 32px 14px 14px; }
  .alm-ecard__day { font-size: 1.75rem; }
}
.alm-ecard:not(.alm-ecard--past) { grid-template-columns: auto minmax(0, 1fr); }
.alm-ecard--media:not(.alm-ecard--past) { grid-template-columns: auto minmax(0, 1fr) auto; }

/* The whole card opens the event. */
.alm-ecard a.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 28px; }
.alm-ecard a.card-link:focus-visible { outline: none; }
.alm-ecard:has(a.card-link:focus-visible) { outline: 3px solid var(--alm-green); outline-offset: 4px; }
.alm-ecard:has(a.card-link:hover) { border-color: rgba(16, 85, 31, 0.3); box-shadow: 0 22px 44px rgba(16, 85, 31, 0.12); }
.alm-ecard:has(a.card-link:hover) .alm-ecard__title a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

/* Past events: two to a row, quieter. */
.alm-elist--past { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.alm-ecard--past { padding: 16px 20px 16px 16px; border-radius: 24px; }
.alm-ecard--past .alm-ecard__date { width: 72px; min-height: 84px; border-radius: 36px 36px 14px 14px; background: var(--alm-bone); color: var(--alm-body); }
.alm-ecard--past { grid-template-columns: 72px minmax(0, 1fr); }
.alm-ecard--past .alm-ecard__day { font-size: 1.875rem; }
.alm-c .alm-ecard--past .alm-ecard__title { font-size: 1.25rem; }

/* --------------------------------------------------------------------------
   Nothing scheduled
   ----------------------------------------------------------------------- */
.alm-evempty {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 5cqi, 56px) clamp(20px, 5cqi, 56px);
  border: 1px solid var(--alm-line);
  border-radius: 32px;
  background: var(--alm-bone);
  text-align: center;
}
.alm-evempty__icon {
  display: grid;
  place-items: center;
  width: 96px;
  height: 108px;
  border-radius: 48px 48px 18px 18px;
  background: #EEF3D0;
  color: var(--alm-green);
}
.alm-evempty__icon svg { width: 60px; height: 60px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alm-evempty__text { display: grid; justify-items: center; gap: 12px; }
.alm-c .alm-evempty h3 {
  margin: 0;
  color: var(--alm-ink);
  font-family: var(--heading-font-family, "Gallery", serif);
  font-size: clamp(1.5rem, 1.2rem + 1cqi, 2rem);
  font-weight: 500;
  line-height: 1.2;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "calt" 0, "swsh" 0;
  text-wrap: balance;
}
.alm-evempty p { max-width: 54ch; margin: 0; color: var(--alm-body); font-size: 1rem; line-height: 1.7; text-wrap: pretty; }
.alm-evempty__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; margin-top: 8px; }
.alm-evempty__link { color: var(--alm-green); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.alm-evempty__link:hover { text-decoration-thickness: 2px; }

@media (prefers-reduced-motion: reduce) {
  .alm-ecard { transition: none; }
}

/* --------------------------------------------------------------------------
   Single event. The article header, image and reading column come from
   journal.css (loaded as a dependency on event pages).
   ----------------------------------------------------------------------- */
.alm-event { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(56px, 7cqi, 96px); }
.alm-eventpage__tags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.alm-eventpage__status {
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--alm-bone);
  color: var(--alm-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.alm-eventpage__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@container almc (min-width: 1000px) {
  .alm-eventpage__layout { grid-template-columns: minmax(0, 42rem) minmax(0, 360px); justify-content: center; column-gap: 56px; }
  .alm-eventpage__layout > .alm-eventpage__details { position: sticky; top: 120px; grid-column: 2; grid-row: 1; }
  .alm-eventpage__layout > .alm-eventpage__body { grid-column: 1; grid-row: 1; }
  /* No description: the card sits centred under the header. */
  .alm-eventpage__layout:not(:has(> .alm-eventpage__body)) { grid-template-columns: minmax(0, 560px); }
  .alm-eventpage__layout:not(:has(> .alm-eventpage__body)) > .alm-eventpage__details { position: static; grid-column: 1; }
}

/* The details card. */
.alm-eventpage__details {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding: 24px 24px 26px;
  border: 1px solid var(--alm-line);
  border-radius: 28px;
  background: #FFFFFF;
  box-shadow: 0 18px 40px rgba(16, 85, 31, 0.06);
}
.alm-c .alm-eventpage__dtitle {
  margin: 0;
  color: var(--alm-ink);
  font-family: var(--heading-font-family, "Gallery", serif);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "calt" 0, "swsh" 0;
}
.alm-eventpage__details dl { margin: 0; border-top: 1px solid var(--alm-line); }
.alm-eventpage__details dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--alm-line); }
.alm-eventpage__details dt { margin: 0; padding-top: 2px; color: var(--alm-body); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.5; text-transform: uppercase; }
.alm-eventpage__details dd { display: grid; gap: 3px; margin: 0; color: var(--alm-ink); font-size: 0.9375rem; line-height: 1.55; overflow-wrap: anywhere; }
.alm-eventpage__details dd a,
.alm-eventpage__ics { color: var(--alm-green); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.alm-eventpage__details dd a:hover,
.alm-eventpage__ics:hover { text-decoration-thickness: 2px; }
.alm-eventpage__venue { font-weight: 700; }
.alm-eventpage__cal { display: grid; gap: 10px; }
.alm-eventpage__caltitle { margin: 0; color: var(--alm-body); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.alm-eventpage__cal > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.alm-eventpage__ics { font-size: 0.9375rem; }

/* Event descriptions are often short: no drop cap. */
.alm-event .alm-article__body > p:first-child::first-letter { float: none; margin: 0; color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; }
