/* The story page (catering-sushibord-50-arsdag.php). Loads after catering.css. */

/* ---------- 1. Cover ---------- */

.ct-cover {
  position: relative;
  color-scheme: dark;
  background: var(--ct-night);
  color: var(--on-night);
}

/* The photo and the cut-out owner share the same crop and box, so they line up exactly.
   Layers from the bottom: the room, a dimming of the room, the title, the owner and the fade into the evening.
   The owner is not dimmed, so the owner stands out in front of the title. All sizes are in cqw, so the title follows the photo. */
.ct-cover-frame {
  position: relative;
  display: grid;
  max-width: 1480px;
  margin-inline: auto;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
}

.ct-cover-frame > * { grid-area: 1 / 1; min-width: 0; }
.ct-cover-frame picture { display: block; }

.ct-cover-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 0;
}

.ct-cover-bg { z-index: 0; }
.ct-cover-cut { z-index: 3; pointer-events: none; }

.ct-cover-frame::before {
  content: "";
  grid-area: 1 / 1;
  z-index: 1;
  background: rgba(21, 20, 19, 0.6);
  pointer-events: none;
}

.ct .ct-cover-title {
  z-index: 2;
  align-self: start;
  padding: 15.5cqw 4.1cqw 0;
  font-size: 10.8cqw;
  line-height: 0.98;
  color: var(--ct-paper);
}

.ct-cover-title span { display: block; }

/* The bottom of the photo fades into the evening */
.ct-cover-frame::after {
  content: "";
  grid-area: 1 / 1;
  z-index: 4;
  background: linear-gradient(to top, var(--ct-night) 0%, rgba(21, 20, 19, 0) 22%);
  pointer-events: none;
}

.ct-cover-side {
  display: grid;
  gap: 18px;
  padding-top: 4px;
  padding-bottom: 8px;
}

.ct-cover-side .ct-deck { color: var(--on-night); }

@media (min-width: 768px) {
  .ct-cover-frame img { aspect-ratio: 16 / 9; max-height: 100svh; }
  /* Darkest behind the title on the left, lighter towards the right */
  .ct-cover-frame::before { background: linear-gradient(100deg, rgba(21, 20, 19, 0.72) 0%, rgba(21, 20, 19, 0.5) 55%, rgba(21, 20, 19, 0.42) 100%); }
  .ct .ct-cover-title { padding: 11.6cqw 2.8cqw 0; font-size: 6.5cqw; }
}

/* On desktop the deck and button sit at the bottom right of the photo, so the button is visible without scrolling */
@media (min-width: 992px) {
  .ct-cover-frame::after {
    background: linear-gradient(to top, var(--ct-night) 0%, rgba(21, 20, 19, 0.82) 22%, rgba(21, 20, 19, 0) 52%);
  }

  .ct-cover-side {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 48px;
    z-index: 5;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 18px 40px;
    padding: 0 var(--ct-gutter);
  }

  .ct-cover-side > * { grid-column: 2; justify-self: start; }
}

/* ---------- The story ---------- */

.ct-story-title { color: var(--on-night); }
.ct-story-head .ct-byline { margin-top: 20px; margin-bottom: 24px; }

/* ---------- 2. On desktop, scrolling drives the clock ---------- */

.ct-strip-now { display: none; }

@media (max-width: 991.98px) {
  .ct-strip-stage { display: contents; }
}

@media (min-width: 992px) {
  /* One screen height for the stage, and 60% of a screen height for each photo change */
  /* The photo credit comes after the stage, at the bottom of the tall section */
  .ct-sak .ct-strip {
    display: flex;
    flex-direction: column;
    height: calc(100vh + 7 * 60vh);
    margin-top: 40px;
  }

  /* Auto margins shrink items in a flex column, so the width is set explicitly */
  .ct-sak .ct-strip .ct-credit { width: 100%; margin-top: auto; }

  .ct-strip-stage {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 40px;
    width: 100%;
    height: 100vh;
    max-width: var(--ct-max);
    margin-inline: auto;
    padding-inline: var(--ct-gutter);
  }

  .ct-sak .ct-strip-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .ct-sak .ct-clock { width: auto; font-size: 6rem; }

  .ct-strip-now {
    display: block;
    min-height: 2.7em;
    max-width: 16em;
    font-size: 1.625rem;
    line-height: 1.3;
    color: var(--on-night);
    text-wrap: balance;
  }

  .ct-sak .ct-track { flex: none; width: min(100%, 360px); }
  .ct-sak .ct-strip-buttons { display: none; }

  .ct-sak .ct-strip-list {
    position: relative;
    display: block;
    justify-self: end;
    height: min(80vh, 780px);
    aspect-ratio: 4 / 5;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .ct-sak .ct-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 600ms ease-out, transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
  }

  .ct-sak .ct-frame.is-active { opacity: 1; transform: none; }

  .ct-sak .ct-strip.is-live .ct-frame img,
  .ct-sak .ct-strip.is-live .ct-frame:not(.is-active) img { height: 100%; aspect-ratio: auto; opacity: 1; }

  .ct-sak .ct-frame-cap { display: none; }
}

/* ---------- 3. The logo mark as end mark and divider ---------- */

/* End mark after the last paragraph, the way magazines mark the end of a story */
.ct-endmark {
  display: inline-block;
  width: 2.2em;
  height: 1em;
  margin-left: 0.45em;
  vertical-align: -0.12em;
  color: var(--on-night);
}

/* Divider between sections, instead of ⁂ */
.ct-dinkus {
  display: flex;
  justify-content: center;
  padding-top: calc(var(--ct-space) * 0.8);
  color: var(--ink);
}

.ct-dinkus svg { width: 64px; height: 29px; }

.ct-sak .ct-dinkus + section { padding-top: calc(var(--ct-space) * 0.7); }

@media (prefers-reduced-motion: reduce) {
  .ct-sak .ct-frame { transition: none; transform: none; }
}

/* ---------- The story on its own page ---------- */

.ct-sak .ct-sak-end { padding-top: calc(var(--ct-space) * 0.7); padding-bottom: var(--ct-space); }
.ct-sak .ct-sak-end .ct-body { margin-top: 14px; }

.ct-sak-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 24px;
}

/* One big word behind the owner, and a smaller line clear of the face */
.ct-sak .ct .ct-cover-title { font-size: 14cqw; padding-top: 15cqw; }
.ct-sak .ct-cover-small { margin-top: 0.12em; font-size: 0.41em; line-height: 1.05; }

@media (min-width: 768px) {
  .ct-sak .ct-cover-small { font-size: 0.45em; }
}

@media (min-width: 768px) {
  .ct-sak .ct .ct-cover-title { font-size: 8.4cqw; padding-top: 11.2cqw; }
}
