/* page_header: a screen's identity and its task actions, at one heading scale.
   Replaces h3 (uppercase 22px), h4 (18px strong) and h5 page titles. */
.block_page_header {
  --block-page-title-size: var(--ui-font-size-title);
  --block-page-title-weight: var(--ui-weight-light);
  --block-page-subtitle-size: var(--ui-font-size-label);

  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--ui-space-3) var(--ui-space-6);
  margin: 0 0 var(--ui-section-gap);
}

/* A record's facts on one line under its header (detail_list layout:
   :inline) sit close under the title, as part of the header. */
.block_page_header:has(+ .block_detail_list[data-layout='inline']) {
  margin-block-end: var(--ui-space-2);
}

/* prominent: true, a name that is the person's own work (the website they
   are building): larger and semibold, above the usual page title. */
.block_page_header[data-prominent] {
  --block-page-title-size: var(--ui-font-size-page-title);
  --block-page-title-weight: var(--ui-weight-strong);
}

/* sticky: true keeps the header in reach while the person writes below it
   (a blog post). It stays at the top on the canvas. Its title is quiet, so
   the work's own title field leads. A toolbar that sticks below it reads its
   height, --block-page-header-height (blogs/initialiser.js). */
.block_page_header[data-sticky] {
  --block-page-title-size: var(--ui-font-size-body);
  --block-page-title-weight: var(--ui-weight-medium);

  position: sticky;
  inset-block-start: 0;
  z-index: var(--ui-layer-sticky-header);
  align-items: center;
  padding-block: var(--ui-space-2);
  background-color: var(--color-canvas);
}

.block_page_header_text {
  flex: 1 1 auto;
  min-width: 0;
}

/* The #main copy outranks the legacy "#main h3/h4" heading rules when a
   screen asks for another heading level. */
.block_page_header_title,
#main .block_page_header_title {
  width: auto;
  margin: 0;
  padding: 0;
  color: var(--color-heading);
  font-family: var(--ui-font-family);
  font-size: var(--block-page-title-size);
  font-weight: var(--block-page-title-weight);
  line-height: 1.2;
  text-transform: none;
  overflow-wrap: anywhere;
}

.block_page_header_subtitle {
  margin: var(--ui-space-1) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--block-page-subtitle-size);
  line-height: var(--ui-line-height-body);
}

.block_page_header > .block_actions {
  flex: 0 1 auto;
}

.block_page_header_summary {
  flex: 0 1 calc(var(--ui-space-8) * 7);
  min-width: 0;
  max-width: 100%;
  align-self: flex-start;
}

.block_page_header:has(> .block_page_header_summary) {
  align-items: flex-start;
  container-type: inline-size;
}

.block_page_header_summary > .block_nav_card_meter_compact {
  width: 100%;
  margin: 0;
}

@container (width <= 480px) {
  .block_page_header_summary {
    flex-basis: 100%;
  }
}
