/* ==========================================================================
   The Resources Library (membership.html, #resources; assets/js/resources.js)

   A short film of the library: a ring draws round the word Resources, a
   hundred numbered guides fill it and are counted, the most liked come
   forward, and all hundred gather into the Circle's mark.

   By default (no script, or reduced motion) this is a still: the mark and
   the closing line "100 Resources. Guides for the performing arts". The
   script adds .rl-live, and only then do the counting panel, the opening
   title and the "Watch again" button show.
   ========================================================================== */
.rl-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0 6vw; align-items: center;
}

/* The drawing. An explicit square box rather than height: auto, so every
   browser gives the SVG and the labels laid over it the same frame. */
.rl-stage { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1 / 1; justify-self: center; }
.rl-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.rl-frame { stroke: var(--ink); }
.rl-disc { fill: var(--ink); }
.rl-svg text { font-family: var(--font); font-weight: 500; letter-spacing: .02em; }
.rl-links line { stroke: var(--mist); stroke-width: .6; }
.rl-halo { fill: none; stroke: var(--ink); stroke-width: .8; }

.rl-eyebrow {
  display: block; margin: 0;
  font-size: 10px; font-weight: 500; letter-spacing: var(--track-eyebrow); text-transform: uppercase;
  color: var(--ink);
}

/* The opening title, centred inside the ring. */
.rl-intro {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none;
}
.rl-intro__title {
  margin: 14px 0 12px; padding-left: .2em;  /* the tracking would otherwise pull the word left of centre */
  font-size: clamp(30px, 5.4vw, 52px); font-weight: 200; letter-spacing: .2em; text-transform: uppercase; color: var(--ink);
  line-height: 1;
}
.rl-intro__sub { font-size: 10px; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--steel-text); }
.rl-intro__sub b { font-weight: 500; color: var(--ink); }

/* The labels laid over the guides. */
.rl-tip {
  position: absolute; z-index: 2; width: max-content; max-width: 46%;
  padding: 10px 14px 11px; border: 1px solid var(--mist); border-radius: 10px;
  background: rgba(243, 244, 245, .94); color: var(--ink);
  box-shadow: 0 6px 24px rgba(28, 62, 85, .08);
  pointer-events: none; opacity: 0;
}
.rl-tip__no { display: block; font-size: 9px; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--steel-text); margin-bottom: 4px; }
.rl-tip__t { display: block; font-size: 11px; line-height: 1.45; letter-spacing: .12em; text-transform: uppercase; font-weight: 400; }
.rl-tip--dark { background: rgba(28, 62, 85, .94); border-color: var(--ink); color: var(--azure); }
.rl-tip--dark .rl-tip__no { color: var(--mist); }

/* Beside the drawing: the counting panel and the closing line share one
   place, one taking over from the other. */
.rl-side { display: grid; align-items: center; }
.rl-panel, .rl-end { grid-area: 1 / 1; }

.rl-panel { display: none; }
.rl-count { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 14px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.rl-count__num { font-size: clamp(48px, 6vw, 72px); font-weight: 200; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 3ch; }
.rl-count__label { font-size: 10px; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--steel-text); }
.rl-bar { height: 4px; background: var(--hairline); overflow: hidden; }
.rl-bar i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left center; }
.rl-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 10px; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--steel-text); font-variant-numeric: tabular-nums; }
.rl-pop { margin-top: 34px; }
.rl-pop ol { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--hairline); }
.rl-pop li {
  display: grid; grid-template-columns: 34px 1fr; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--hairline);
  font-size: 11px; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; color: var(--slate);
}
.rl-pop li span { font-size: 20px; font-weight: 200; letter-spacing: 0; color: var(--ink); }

.rl-end__num { margin: 14px 0 0; font-size: clamp(80px, 11vw, 132px); font-weight: 200; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.rl-end__word { margin: 10px 0 18px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 300; letter-spacing: .14em; text-transform: uppercase; line-height: 1.1; }
.rl-end__line { margin: 0; font-size: 11px; letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--steel-text); }
.rl-end__line b { font-weight: 500; color: var(--ink); }

.rl-again {
  margin-top: 28px; padding: 10px 18px; border: 1px solid var(--mist); border-radius: 999px; background: none;
  font: inherit; font-size: 10px; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink); cursor: pointer;
}
.rl-again:hover { border-color: var(--ink); }

/* Only while the film can play. */
.rl:not(.rl-live) .rl-intro { display: none; }
.rl-live .rl-panel { display: block; }
.rl-live .rl-intro, .rl-live .rl-end > :not(.rl-again) { opacity: 0; }

/* Phones: the drawing on top, the numbers underneath, as in a portrait cut. */
@media (max-width: 860px) {
  .rl-grid { grid-template-columns: 1fr; gap: 28px; }
  .rl-side { align-items: start; }   /* the closing line sits just under the mark, not halfway down the panel's space */
  .rl-stage { max-width: 440px; }
  .rl-end { text-align: center; }
  .rl-tip { max-width: 58%; padding: 7px 10px 8px; border-radius: 8px; }
  .rl-tip__t { font-size: 9px; letter-spacing: .1em; }
  .rl-tip__no { font-size: 8px; }
  .rl-pop { margin-top: 24px; }
}
