/* ============================================================
   UPCOMING EVENTS — International Typographic Style (Swiss)
   ------------------------------------------------------------
   Same grid, gutter and type scale as the rest of the site.

   The old file did three things this one does not: it set a
   background photograph on `.video-background-container`, a
   class four other places still use; it put the hero's title
   and text in `position: fixed`, so they stayed pinned to the
   viewport while the page scrolled underneath them; and it
   sized everything in `vh`.
   ============================================================ */

/* Preflight is off in this project, so border-box is not the default. */
.upc-hero,
.upc-hero *,
.upc-body,
.upc-body * {
  box-sizing: border-box;
}

.upc-hero,
.upc-body {
  --upc-ink: #000;
  --upc-paper: #fff;
  --upc-accent: #ff820d;
  --upc-muted: #5c5c5c;
  --upc-rule: #d8d8d8;
  --upc-rule-strong: #000;

  --upc-gutter: clamp(1.25rem, 5vw, 6rem);
  --upc-max: 1440px;

  font-family: 'Sofia Pro', sans-serif;
}

/* ============================================================
   Hero
   ============================================================ */
.upc-hero {
  position: relative;
  width: 100%;
  min-height: min(78svh, 720px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #1b1b1b;
}

.upc-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  /* Anchored to the top of the frame: `center` splits the crop between top
     and bottom, which takes the tops of heads off a photograph of people.
     Trimming from the bottom instead keeps faces in. */
  background-position: center top;
  background-repeat: no-repeat;
}

.upc-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.84) 0%,
    rgba(0, 0, 0, 0.52) 45%,
    rgba(0, 0, 0, 0.26) 100%
  );
}

.upc-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--upc-max);
  margin: 0 auto;
  padding: 0 var(--upc-gutter) clamp(3rem, 8vh, 6rem);
}

.upc-hero__overline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 clamp(1rem, 2vw, 1.75rem);
  color: var(--upc-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.upc-hero__overline::before {
  content: "";
  width: clamp(2.5rem, 6vw, 5rem);
  height: 2px;
  background: var(--upc-accent);
  flex: none;
}

.upc-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  max-width: 12ch;
}

/* The lead used to be centred at 4vh with a <br> holding the two sentences
   apart. Flush left on a measure does the same job and survives translation,
   where the line breaks land somewhere else entirely. */
.upc-hero__lead {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  padding-top: clamp(1.25rem, 2.5vw, 1.75rem);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  font-weight: 300;
  line-height: 1.5;
  max-width: 46ch;
}

.upc-hero__cta {
  display: inline-flex;
  align-items: center;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  padding: 1rem 2.25rem;

  background: #fff;
  border: 0;
  border-radius: 0;
  color: #000;

  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .15s ease;
}

.upc-hero__cta:hover {
  background: var(--upc-accent);
}

.upc-hero__cta:focus-visible {
  outline: 2px solid var(--upc-accent);
  outline-offset: 3px;
}

/* ============================================================
   Body — the calendar, with something said about it
   ============================================================ */
.upc-body {
  width: 100%;                     /* was 100vw */
  background: var(--upc-paper);
  color: var(--upc-ink);
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3.5rem, 7vw, 6rem);
  scroll-margin-top: clamp(5rem, 12vh, 7rem);
}

.upc-body__grid {
  max-width: var(--upc-max);
  margin: 0 auto;
  padding-inline: var(--upc-gutter);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1rem, 2vw, 2rem);
  row-gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

/* The events feed used to be the entire page under the hero, with 20vh of
   air above it and nothing to say what it was. */
.upc-body__intro {
  grid-column: 1 / span 4;
  min-width: 0;
  border-top: 2px solid var(--upc-rule-strong);
  padding-top: clamp(0.9rem, 1.6vw, 1.25rem);

  /* Sticks beside the feed while it scrolls: the feed is much taller. */
  position: sticky;
  top: clamp(6rem, 14vh, 8rem);
}

.upc-body__feed {
  grid-column: 6 / span 7;
  min-width: 0;
  border-top: 2px solid var(--upc-rule-strong);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
}

.upc-body__label {
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  color: var(--upc-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.upc-body__title {
  margin: 0 0 clamp(1rem, 2vw, 1.5rem);
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.upc-body__note {
  margin: 0;
  font-size: clamp(0.9375rem, 1.05vw, 1.0625rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--upc-muted);
  max-width: 40ch;
}

/* Subsplash owns everything inside the feed; all this can do is give it the
   width of its column and stop it forcing the page wider than the viewport. */
.upc-body__feed > div {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

/* ============================================================
   Responsive
   ============================================================ */
@media screen and (max-width: 1024px) {

  .upc-body__intro,
  .upc-body__feed {
    grid-column: 1 / -1;
  }

  /* Sticky is for a column standing beside something; stacked it would
     pin the intro over the feed. */
  .upc-body__intro {
    position: static;
  }
}

@media screen and (max-width: 620px) {

  /* Sized to its label, not stretched across the screen: the hero's
     overline, title and lead all begin on the gutter, and a button
     spanning the full measure is the only thing that would not. */
  .upc-hero__cta {
    width: auto;
    align-self: flex-start;
  }

  .upc-hero__lead,
  .upc-body__note {
    max-width: none;
  }
}

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