/* Events (landing page): a ring of pictures from my events that steps round by itself; the picture on the anchor pops up
   large in the featured card beside it (tap one to feature it, drag to spin). Built by js/orbit-gallery.js. */
.events { background: #fff; padding: clamp(40px, 6vw, 64px) 0 clamp(40px, 6vw, 72px); overflow-x: clip; }   /* the space under the button belongs to the white section, so no strip of page colour shows before the footer */
.og-sub { margin: 10px auto 0; max-width: 560px; text-align: center; text-wrap: balance; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.5; color: rgba(12, 0, 84, 0.72); }
.og {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 1 / 1;
  margin: 10px auto 0;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.og.is-dragging { cursor: grabbing; }
.og-ring { position: absolute; inset: 0; }
.og-card {
  position: absolute;
  left: 50%; top: 50%;
  display: block;
  width: var(--card, 120px);
  height: var(--card, 120px);
  margin: calc(var(--card, 120px) / -2) 0 0 calc(var(--card, 120px) / -2);
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--periwinkle);
  box-shadow: 0 0 0 1.5px var(--periwinkle), 0 10px 22px -10px rgba(12, 0, 84, 0.4);
  cursor: inherit;
  will-change: transform;
  transition: box-shadow 0.25s ease, scale 0.3s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.3s ease;
}
.og-card img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
@media (hover: hover) { .og-card:hover { box-shadow: 0 0 0 3px var(--blue), 0 14px 26px -10px rgba(0, 82, 255, 0.5); } }   /* an outline only: nothing grows or moves */
.og-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.og-card.is-featured { box-shadow: 0 0 0 3px var(--blue), 0 14px 26px -10px rgba(0, 82, 255, 0.5); }

/* the middle of the ring */
.og-centre {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  color: var(--navy);
  pointer-events: none;
}
.og-guide { display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity 0.25s ease; }
.og-guide p { margin: 0; font-size: clamp(0.8rem, 1.5vw, 1rem); font-weight: 500; line-height: 1.45; color: rgba(12, 0, 84, 0.72); }

.og-cta { margin: 18px 0 0; text-align: center; }

/* No JS: a simple wrap of pictures */
.og:not(.is-ready) { width: auto; aspect-ratio: auto; cursor: auto; }
.og:not(.is-ready) .og-ring { position: static; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.og:not(.is-ready) .og-card { position: static; margin: 0; width: 120px; height: 120px; }
.og:not(.is-ready) .og-centre { display: none; }
@media (prefers-reduced-motion: reduce) { .og-card { transition: none; } }

/* Wide screens: the heading and its line on the left, the wheel in the middle and the featured picture on the right.
   Narrower screens stack them: heading, wheel, then the featured picture full width underneath. */
@media (min-width: 1100px) {
  .og-layout { display: grid; grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.55fr) minmax(250px, 1.05fr); align-items: center; column-gap: clamp(28px, 3.4vw, 52px); }
  .og-intro { text-align: left; }
  .og-intro .section-heading-row { justify-content: flex-start; text-align: left; }
  .og-intro .og-sub { margin: 12px 0 0; max-width: 340px; font-size: 1rem; text-align: left; text-wrap: balance; }   /* two lines */
  .og-intro .og-cta { text-align: left; }
  .og-layout .og { margin-top: 0; }
}

/* The featured picture: the same rounded corners and 3D layer as the cards above, the event name under it. */
.og-feature { --ar: 1; margin: 18px auto 0; width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }
.og-feature[hidden] { display: none; }
.og-feature-card {
  position: relative; display: block; flex: none;
  width: 100%;
  aspect-ratio: var(--ar);
  border-radius: var(--card-radius, 20px);
  background: var(--periwinkle);
  transition: width 0.45s cubic-bezier(0.3, 0.7, 0.2, 1), aspect-ratio 0.45s cubic-bezier(0.3, 0.7, 0.2, 1);
  cursor: pointer;
}
/* stacked layout (tablets and phones): the featured picture is kept smaller */
@media (max-width: 1099px) {
  .og-feature { margin-top: 8px; gap: 12px; }
  .og-feature-card { width: min(100%, calc(min(34svh, 300px) * var(--ar))); }
}
/* tablets and short landscape screens have the width for a bigger picture: it never goes below 350px */
@media (min-width: 600px) and (max-width: 1099px) {
  .og-feature-card { width: min(100%, calc(max(350px, min(34svh, 420px)) * var(--ar))); }
}
.og-feature-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 6px; }
.og-feature-card:not([href]) { cursor: default; }
.og-feature-a, .og-feature-b { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.og-feature-b { opacity: 0; }                    /* the previous picture, only shown while it fades out */
.og-feature-a img, .og-feature-b img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.og-feature-name { width: 100%; text-align: center; display: flex; flex-direction: column; gap: 6px;
  min-height: calc(clamp(1.3rem, 2.6vw, 2rem) * 1.05 + 6px + 2 * clamp(0.85rem, 1.5vw, 1rem) * 1.4); }   /* room for a one-line name and a two-line sentence, so the page never jumps when the picture changes */
.og-feature-name strong { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.05; color: var(--blue); }
.og-feature-name span { font-size: clamp(0.85rem, 1.5vw, 1rem); line-height: 1.4; color: rgba(12, 0, 84, 0.75); text-wrap: balance; }
.og-feature-name strong:empty, .og-feature-name span:empty { display: none; }
@media (min-width: 1100px) {
  .og-feature { margin-top: 0; max-width: none; }
  /* as large as fits the screen's height, at the picture's own shape */
  .og-feature-card { width: min(100%, calc(min(54svh, 480px) * var(--ar))); }
}
@media (prefers-reduced-motion: reduce) { .og-feature-card { transition: none; } }

/* the fidget spinner in the middle: it turns with the ring (faster), and wobbles until someone first spins it */
.og-spin { position: relative; width: clamp(112px, 12vw, 190px); aspect-ratio: 1; }
.og-spinner { display: block; width: 100%; height: 100%; overflow: visible; will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .og:not(.has-spun) .og-spin { animation: ogWobble 2.2s ease-in-out infinite; }
}
@keyframes ogWobble { 0%, 100% { transform: rotate(-9deg) scale(1); } 50% { transform: rotate(9deg) scale(1.05); } }

.og-spin { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.og-spark { position: absolute; left: 50%; top: 50%; pointer-events: none; opacity: 0; }
