.cafe-story-page {
  color-scheme: light dark;
  --terra-d: #a44320;
  --story-prose: #5d564e;
  --story-nav: rgb(251 246 239 / 92%);
  background: var(--cream);
  color: var(--ink);
}

.cafe-story-page header.article-nav {
  background: var(--story-nav);
}

.cafe-story-page a:focus-visible,
.cafe-story-viewer button:focus-visible {
  outline: 2px solid var(--terra-d);
  outline-offset: 3px;
}

.cafe-story-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  max-width: 1080px;
}

.cafe-story-hero h1 {
  font-size: clamp(2rem, 3.8vw, 3.05rem);
  text-wrap: balance;
}

.cafe-story-copy {
  margin-top: 32px;
}

.cafe-story-page .article-copy :is(p, li) {
  color: var(--story-prose);
}

.cafe-story-photo {
  margin: 22px 0;
}

.cafe-story-hero .cafe-story-photo {
  margin: 0;
}

.cafe-story-photo--portrait {
  max-width: 460px;
  margin-inline: auto;
}

.cafe-story-photo a {
  display: block;
  border-radius: var(--r-sm);
  cursor: zoom-in;
}

.cafe-story-photo picture {
  display: block;
  border-radius: inherit;
}

.cafe-story-photo img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: inherit;
}

.cafe-story-photo figcaption {
  margin-top: 8px;
  color: var(--story-prose);
  font-size: .9rem;
}

.cafe-story-viewer {
  --terra-d: #ffac87;
  width: min(1120px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 14px;
  overflow: auto;
  border: 1px solid #554941;
  border-radius: var(--r);
  background: #211a17;
  color: #fff6ed;
}

.cafe-story-viewer[open] {
  display: grid;
  gap: 8px;
}

.cafe-story-viewer::backdrop {
  background: rgb(20 16 13 / 86%);
}

.cafe-story-viewer-close {
  justify-self: end;
}

.cafe-story-viewer-close button {
  width: 44px;
  height: 44px;
  border: 1px solid #68584e;
  border-radius: 50%;
  background: #312820;
  color: inherit;
  font-size: 1.6rem;
  cursor: pointer;
}

.cafe-story-viewer img {
  max-height: calc(100dvh - 172px);
  width: auto;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

.cafe-story-viewer figcaption {
  margin-top: 9px;
  text-align: center;
}

.cafe-story-viewer-file {
  justify-self: center;
  padding: 5px 8px;
  text-decoration: underline;
  text-underline-offset: .18em;
}

@media (max-width: 720px) {
  .cafe-story-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .cafe-story-photo--portrait {
    max-width: none;
  }
}

@media (prefers-color-scheme: dark) {
  .cafe-story-page {
    --cream: #181411;
    --ink: #f2eade;
    --line: #473b33;
    --terra-d: #ffac87;
    --story-prose: #d7cabe;
    --story-nav: rgb(29 24 20 / 94%);
  }
}
