/* Page chrome for the full-page reader and shared recipe pages. */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--pc-bg);
  color: var(--pc-ink);
  font: var(--pc-text-base) / var(--pc-leading-body) var(--pc-font-ui);
}
a {
  color: inherit;
  cursor: pointer;
}

.bar {
  border-bottom: 1px solid var(--pc-rule);
}
.bar-inner,
.page {
  width: min(72rem, 100% - 2 * var(--pc-gutter));
  margin-inline: auto;
}
.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pc-space-4);
  min-height: 3.5rem;
}
.bar-brand {
  display: flex;
  align-items: baseline;
  gap: var(--pc-space-2);
  min-width: 0;
  margin: 0;
}
.wordmark {
  font: 600 var(--pc-text-base) / 1 var(--pc-font-read);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.bar-publisher {
  overflow: hidden;
  color: var(--pc-ink-subtle);
  font-size: var(--pc-text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-publisher:not(:empty)::before {
  content: "/";
  margin-right: var(--pc-space-2);
  color: var(--pc-rule);
}
.bar-actions {
  display: flex;
  align-items: center;
  gap: var(--pc-space-5);
  flex: none;
  font-size: var(--pc-text-sm);
}
.bar-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--pc-control-height);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--pc-control);
  text-underline-offset: 0.25em;
}
.bar-link:hover {
  text-decoration-color: currentColor;
}

.page {
  min-height: 70vh;
  padding-block: clamp(2rem, 1.2rem + 3vw, 4rem) var(--pc-space-8);
}
.page-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--pc-space-2) var(--pc-space-5);
  margin-top: var(--pc-space-3);
  color: var(--pc-ink-muted);
  font-size: var(--pc-text-sm);
}

/* Loading and problems */
.reader {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.reader .bar {
  flex: none;
}
.reader .page:has(.loading) {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  padding-block: var(--pc-space-8);
}
.loading {
  width: 100%;
}
.problem h1 {
  margin: 0 0 var(--pc-space-6);
  font: 500 var(--pc-text-2xl) / var(--pc-leading-tight) var(--pc-font-read);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.problem {
  max-width: 34rem;
}
.problem p {
  margin: 0 0 var(--pc-space-5);
  color: var(--pc-ink-muted);
  font-size: var(--pc-text-lg);
  line-height: 1.5;
}

@media (max-width: 34rem) {
  .bar-publisher {
    display: none;
  }
  /* Actions move under the wordmark rather than overlapping it. */
  .bar-inner {
    flex-wrap: wrap;
    row-gap: 0;
    padding-block: var(--pc-space-1);
  }
  .bar-actions {
    gap: var(--pc-space-4);
    margin-left: auto;
  }
}
@media print {
  .bar,
  .page-foot {
    display: none;
  }
  .page {
    width: 100%;
    padding: 0;
  }
}
/* Shared pages render their controls with JavaScript. */
@media (scripting: none) {
  #recipe-actions {
    display: none;
  }
}

.bar-link[hidden] { display: none; }
