/*
  Events (/events/ and /desk/events/). Layout only: every colour, font, space and
  radius is a token from akili.css (docs/DESIGN.md). Phone first.
*/

/* ---------- Cards in the lists ---------- */
.event-cards { display: grid; gap: var(--space-6); }
@media (min-width: 700px) { .event-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .event-cards { grid-template-columns: repeat(3, 1fr); } }

.event-card { display: flex; flex-direction: column; height: 100%; padding: 0; overflow: hidden; color: var(--ink); }
.event-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--pool); overflow: hidden; }
.event-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.event-card:hover .event-card__media img { transform: scale(1.03); }
.event-card__media--empty { display: grid; place-items: center; color: var(--silver); }
.event-card__media--empty .mark { font-size: 2.2rem; color: var(--white); }
.event-card__tags { position: absolute; left: var(--space-4); bottom: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.event-card__tags .badge { background: rgb(255 255 255 / 92%); }
.event-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5) var(--space-5) var(--space-6); flex: 1; }
.event-card__body h3 { margin: 0; font-size: 1.6rem; }
.event-card__when, .event-card__where { display: flex; gap: var(--space-2); align-items: flex-start; margin: 0; font-size: 0.9rem; color: var(--muted); }
.event-card__when svg, .event-card__where svg { flex: none; margin-top: 0.3rem; }
.event-card__price { margin: auto 0 0; padding-top: var(--space-3); font-family: var(--font-ui); font-weight: 600; font-size: 0.9rem; }
.event-card__price span { font-weight: 500; color: var(--muted); }

/* ---------- The annual event band (dark water) ---------- */
.event-annual__grid { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 900px) { .event-annual__grid { grid-template-columns: 1.05fr 1fr; gap: 5rem; } }
.event-annual__media { position: relative; margin: 0; }
.event-annual__media img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 2px; }
/* The ripples from the red dot: two quiet rings behind the picture (the signature detail, docs/DESIGN.md). */
.event-annual__media::before, .event-annual__media::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgb(255 255 255 / 10%); pointer-events: none; }
.event-annual__media::before { width: 62%; aspect-ratio: 1; right: -9%; top: -14%; }
.event-annual__media::after { width: 88%; aspect-ratio: 1; right: -22%; top: -28%; border-color: rgb(255 255 255 / 6%); }
.event-annual__media img { position: relative; z-index: 1; }
.event-annual h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: var(--space-4); }
.event-next { margin: var(--space-6) 0; padding: var(--space-5) 0; border-top: 1px solid rgb(255 255 255 / 14%); border-bottom: 1px solid rgb(255 255 255 / 14%); }
.event-next__label { margin: 0 0 var(--space-1); font-family: var(--font-ui); font-size: 0.85rem; color: var(--silver); }
.event-next__title { margin: 0; font-family: var(--font-heading); font-size: 1.7rem; line-height: 1.2; color: var(--white); }
.event-next__when { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 0; color: var(--on-dark); }
.event-next__when::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--akili-red); flex: none; }
.event-annual__past { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.event-annual__past a { font-family: var(--font-ui); font-weight: 600; font-size: 0.9rem; }

/* ---------- One event's page ---------- */
.event-hero__grid { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) { .event-hero__grid { grid-template-columns: 1.1fr 1fr; gap: 4.5rem; } }
.event-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: var(--space-4); }
.event-hero__back { display: inline-block; margin-bottom: var(--space-5); font-family: var(--font-ui); font-size: 0.85rem; color: var(--silver); }
.event-hero__media { margin: 0; }
.event-hero__media img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 2px; }
.event-facts { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.event-facts li { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--on-dark); }
.event-facts svg { flex: none; margin-top: 0.3rem; color: var(--silver); }
.event-facts b { color: var(--white); font-weight: 600; }

.event-layout { display: grid; gap: var(--space-7); }
@media (min-width: 960px) { .event-layout { grid-template-columns: minmax(0, 1fr) 24rem; gap: 4.5rem; align-items: start; } .event-aside { position: sticky; top: 7rem; } }
.event-main > * + * { margin-top: var(--space-7); }
.event-main h2 { font-size: 2rem; }
.event-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--pool); }
.event-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.event-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--pool); }
.event-body { max-width: var(--text-width); }
.event-body.lib-reading { font-size: 1rem; line-height: 1.8; }
.event-body.lib-reading p { margin: 0 0 var(--space-4); overflow-wrap: anywhere; }

.event-gallery { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .event-gallery { grid-template-columns: repeat(3, 1fr); } }
.event-gallery figure { margin: 0; }
.event-gallery a { display: block; overflow: hidden; border-radius: 2px; background: var(--paper); }
.event-gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 0.4s ease; }
.event-gallery a:hover img { transform: scale(1.04); }
.event-gallery figcaption { margin-top: var(--space-2); font-size: 0.8rem; color: var(--muted); }

.event-aside .card { box-shadow: var(--shadow); border-color: transparent; }
.event-price { margin: 0; font-family: var(--font-heading); font-size: 2.4rem; line-height: 1.1; }
.event-price small { font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-right: var(--space-1); }
.event-price__per { margin: var(--space-1) 0 var(--space-4); font-size: 0.85rem; color: var(--muted); }
.event-member { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--paper); font-size: 0.9rem; }
.event-member b { font-weight: 600; }
.event-aside .form { padding: 0; border: 0; }
.event-aside h2 { font-size: 1.6rem; margin-bottom: var(--space-2); }
.event-when-tbc { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); font-family: var(--font-ui); font-weight: 600; }
.event-when-tbc::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--akili-red); flex: none; }
.event-editions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.event-editions a { font-weight: 600; }

/* ---------- The desk ---------- */
.event-desk-section { margin-top: var(--space-7); }
.event-desk-thumbs { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); margin-bottom: var(--space-5); }
.event-desk-thumbs figure { margin: 0; }
.event-desk-thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--paper); }
.event-desk-thumbs figcaption { margin-top: var(--space-1); font-size: 0.8rem; color: var(--muted); }
.event-desk-thumbs form { margin-top: var(--space-1); }
.event-desk-cover { display: block; width: 100%; max-width: 28rem; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); }
.event-desk-video { display: block; width: 100%; max-width: 28rem; border-radius: var(--radius); background: var(--pool); }
.event-desk-cancel summary { cursor: pointer; font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600; }
.event-desk-cancel form { margin-top: var(--space-3); }
.event-annual__past-label { margin-top: var(--space-6); }
.event-card__tags .badge::before { display: none; }
.event-card__tags .badge svg { width: 0.95em; height: 0.95em; }
.event-fieldset { border: 0; padding: 0; margin: 0 0 var(--space-6); min-width: 0; }
.event-fieldset + .event-fieldset { padding-top: var(--space-6); border-top: 1px solid var(--line); }
.event-fieldset legend { float: left; width: 100%; padding: 0; margin-bottom: var(--space-4); font-family: var(--font-heading); font-size: 1.5rem; }
.event-fieldset legend + * { clear: both; }
.event-fieldset__pair { display: grid; gap: 0 var(--space-5); }
@media (min-width: 700px) { .event-fieldset__pair { grid-template-columns: 1fr 1fr; } }
.event-facts svg, .event-card__when svg, .event-card__where svg { width: 1.1em; height: 1.1em; }
.event-annual { overflow: hidden; }
.event-desk-section .table-wrap { position: relative; } /* keeps the hidden "Actions" heading inside the scrolling table */
.event-desk-section .table-wrap + .small { margin-top: var(--space-3); }
/* On a phone, booking (or "tell me the dates") comes straight after the event's heading. */
@media (max-width: 959px) { .event-layout--act-first .event-aside { order: -1; } }

/* Two pictures taking turns (an event's cover and its second picture): they SLIDE, so each is
   always seen in its true colours and never mixed (Papa, 6 November 2026). 16 seconds round:
   the first shows, slides out to the left as the second slides in, then the second slides out
   and the first comes back. A Pause switch stops it; "reduce motion" shows the first only (WCAG 2.2.2). */
.event-slide { position: relative; }
.event-slide__frames { position: relative; z-index: 1; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 2px; }
.event-slide__frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; border-radius: 0; }
.event-slide__first { animation: event-slide-first 16s ease-in-out infinite; }
.event-slide__next { transform: translateX(100%); animation: event-slide-next 16s ease-in-out infinite; }
@keyframes event-slide-first {
  0%, 42% { transform: translateX(0); }
  50% { transform: translateX(-100%); }
  50.01%, 92% { transform: translateX(100%); }
  100% { transform: translateX(0); }
}
@keyframes event-slide-next {
  0%, 42% { transform: translateX(100%); }
  50%, 92% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.event-slide__pause:checked ~ .event-slide__frames img { animation-play-state: paused; }
.event-slide__toggle { position: absolute; z-index: 2; right: var(--space-3); bottom: var(--space-3); padding: 0.2rem 0.75rem; border-radius: 999px; background: rgb(255 255 255 / 88%); color: var(--ink); font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.event-slide__paused { display: none; }
.event-slide__pause:checked ~ .event-slide__toggle .event-slide__playing { display: none; }
.event-slide__pause:checked ~ .event-slide__toggle .event-slide__paused { display: inline; }
.event-slide__pause:focus-visible ~ .event-slide__toggle { outline: 2px solid var(--akili-red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .event-slide__first, .event-slide__next { animation: none; }
  .event-slide__toggle { display: none; }
}
