/* The page is at least one screen tall. With nothing published yet the hero takes all of it and
   the footer sits at the bottom; with a gallery the hero keeps three quarters of the first screen. */
.home {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.home > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Hero: the logo, the name and the date. Stacked and centred on phones; from 761 px the name
   sits on the left and the logo on the right. Flat colour only: no photo, gradient or shadow. */
.hero {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76svh;
  padding: clamp(48px, 9vh, 96px) var(--gutter);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1240px;
  text-align: center;
}

.hero__logo {
  width: min(50vw, 30vh);
  height: auto;
}

.hero__title {
  margin-top: clamp(22px, 3.6vh, 34px);
  font-size: clamp(32px, 9.4vw, 48px);
  line-height: 1.02;
}

.hero__title span { display: block; }

.hero__date {
  margin: clamp(20px, 3.4vh, 34px) 0 0;
  color: var(--ink-soft);
  font-size: clamp(12px, 1.3vw, 14px);
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
}

.hero__actions { margin-top: clamp(26px, 4.4vh, 44px); }

@media (min-width: 761px) {
  .hero__content {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    column-gap: clamp(24px, 6vw, 96px);
    text-align: left;
  }

  /* The logo spans the three rows on the left: name, date and button. */
  .hero__logo {
    grid-column: 2;
    grid-row: 1 / span 3;
    justify-self: center;
    width: min(32vw, 56vh, 440px);
  }

  .hero__title {
    grid-column: 1;
    align-self: end;
    margin-top: 0;
    font-size: clamp(44px, 6.3vw, 90px);
  }

  .hero__date {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 18px;
  }

  .hero__date::before {
    content: "";
    width: 44px;
    height: 1px;
    background: var(--gold);
  }

  .hero__actions {
    grid-column: 1;
    justify-self: start;
    align-self: start;
  }
}

/* Gallery */
.gallery {
  /* a set width, because the automatic margins would otherwise shrink it to its content */
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 96px) var(--gutter);
  scroll-margin-top: 0;
}

.gallery__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(24px, 4vh, 40px);
}

.gallery__eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.gallery__head h2 {
  font-size: clamp(34px, 6vw, 52px);
}

.filters {
  display: flex;
  gap: 8px;
}

.filters button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  font-weight: 400;
}

.filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
}

.grid {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 1.4vw, 16px);
}

.grid__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vw, 16px);
}

.item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--tint);
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.item:hover img { transform: scale(1.03); }

.item__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, transparent 55%, rgb(40 25 15 / 45%));
}

.item__play svg {
  width: clamp(44px, 9vw, 60px);
  height: auto;
  filter: drop-shadow(0 2px 8px rgb(0 0 0 / 40%));
}

.item__time {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgb(0 0 0 / 55%);
}

.sentinel { height: 1px; }

/* Viewer */
.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(26 17 11 / 96%);
  color: #fff;
}

/* The photo or video takes what the caption leaves, so a long caption never lies over it. */
.viewer[open] {
  display: grid;
  grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
}

.viewer::backdrop { background: rgb(26 17 11 / 96%); }

/* The dark viewer needs a light focus ring: the page's own is the ink colour. */
.viewer :focus-visible { outline-color: #fff; }

/* The stage holds the focus when the viewer opens; it is not a control, so it shows no ring. */
.viewer__stage:focus { outline: none; }

/* The page behind stays where it is while the viewer is open. */
html:has(.viewer[open]) { overflow: hidden; }

.viewer__stage {
  display: grid;
  /* Without a fixed track, percentage heights below have nothing to resolve against. */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-height: 0;
  padding: 56px clamp(8px, 7vw, 88px) 0;
}

.viewer__stage img,
.viewer__stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.viewer__stage video { width: 100%; height: 100%; }

/* One line of caption is 64px tall, as is no caption; a long one grows, then scrolls. */
.viewer__caption {
  min-height: 64px;
  max-height: 34dvh;
  margin: 0;
  padding: 20px var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 15px;
  line-height: 24px;
}

.viewer__fallback { max-width: 420px; text-align: center; padding: 0 16px; }

.viewer__fallback a { color: var(--gold-light); }

.viewer__btn {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 50%;
  background: rgb(0 0 0 / 35%);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.viewer__close { top: 10px; right: 10px; }

.viewer__prev, .viewer__next { top: calc(50% - 55px); }

.viewer__prev { left: 10px; }

.viewer__next { right: 10px; }

/* Footer */
.footer {
  padding: 32px var(--gutter) 40px;
  background: var(--page);
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

.footer p { margin: 0; }

.notfound {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: var(--gutter);
  text-align: center;
  background: var(--tint);
}

.notfound img { width: 120px; }

.notfound h1 { font-size: 34px; }
