/* Inspector section container. The outer panel frame is in user_interface/panels.css. */
.block_panel_section {
  /* The section's inset, and the space between its title, text and form. */
  --block-panel-section-padding: var(--ui-panel-padding);
  --block-panel-section-gap: var(--ui-space-3);
  /* The title: label-sized and strong, as the inspector's sub-sections are. */
  --block-panel-section-title-size: var(--ui-font-size-label);
  --block-panel-section-title-weight: var(--ui-weight-strong);
  /* The intro sentence and the quieter note under it. */
  --block-panel-section-text-size: var(--ui-font-size-label);
  --block-panel-section-note-size: var(--ui-font-size-small);

  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  padding: var(--block-panel-section-padding);
  color: var(--color-text);
  container-type: inline-size;
}

.block_panel_section + .block_panel_section {
  border-block-start: 1px solid var(--color-border-faint);
}

.block_panel_section > * {
  margin-block: 0;
}

.block_panel_section > * + *,
#panels .block_panel_section > * + * {
  margin-block-start: var(--block-panel-section-gap);
}

.block_panel_section_header {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--ui-space-1) var(--ui-space-3);
}

/* Help occupies the same trailing corner even when the section has no title. */
.block_panel_section_header > .block_help_link {
  margin-inline-start: auto;
}

.block_panel_section_title,
#panels .block_panel_section_title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--color-panels-subheading);
  font-family: var(--ui-font-family);
  font-size: var(--block-panel-section-title-size);
  font-weight: var(--block-panel-section-title-weight);
  line-height: var(--ui-line-height-body);
}

.block_panel_section_intro,
.block_panel_section_note,
#panels .block_panel_section_intro,
#panels .block_panel_section_note {
  margin: 0;
  color: var(--color-text-secondary);
  font-family: var(--ui-font-family);
  font-size: var(--block-panel-section-text-size);
  line-height: var(--ui-line-height-body);
}

.block_panel_section_note,
#panels .block_panel_section_note {
  font-size: var(--block-panel-section-note-size);
}

/* A link inside a section's sentence is underlined, so it stands apart from
   the words around it by more than its colour (WCAG 1.4.1). */
.block_panel_section p a:not(.button) {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Text typed as shown, such as a dynamic keyword (<% Day %>): the code type, kept on one line
   so it never breaks between its parts. */
.block_panel_section_note code,
#panels .block_panel_section_note code {
  font-family: var(--ui-font-family-code);
  white-space: nowrap;
}

/* The guide: the intro and note in a lightly tinted box after a light-bulb
   glyph, as DPG's panels always showed them. The glyph sits beside the text,
   so the text lines up under itself. */
.block_panel_section_guide {
  display: flex;
  align-items: center;
  gap: var(--ui-space-3);
  padding: var(--ui-space-3);
  background: var(--color-panels-guide-background);
  border-radius: var(--ui-radius-surface);
}

.block_panel_section_guide::before {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font: var(--ui-icon-weight) var(--ui-icon-size)/1 var(--ui-icon-font-family);
  content: var(--ui-icon-lightbulb) var(--ui-icon-alt,);
}

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

.block_panel_section_guide_text > * + *,
#panels .block_panel_section_guide_text > * + * {
  margin-block-start: var(--ui-space-1);
}

/* The help link (HelpHelper#help_link): a solid info glyph alone, quiet
   until pointed at. The article's name is its tooltip and hidden name.
   Solid, not light, so it never reads as a panel's own light "Information"
   glyph. It sits in its fixed box, so the solid face loading moves nothing. */
.block_help_link,
#panels .block_help_link {
  display: inline-grid;
  place-items: center;
  min-width: var(--ui-toolbar-control);
  min-height: var(--ui-toolbar-control);
  color: var(--color-panels-link);
  text-decoration: none;
}

.block_help_link::before {
  font: 900 var(--ui-icon-size)/1 var(--ui-icon-font-family);
  content: var(--ui-icon-circle-info) var(--ui-icon-alt,);
}

.block_help_link:hover,
#panels .block_help_link:hover {
  color: var(--color-text);
}

.block_help_link:focus-visible {
  outline: 2px solid var(--color-input-focus-border);
  outline-offset: 2px;
}

@media (any-pointer: coarse) {
  .block_help_link,
  #panels .block_help_link {
    min-width: var(--ui-touch-target);
    min-height: var(--ui-touch-target);
  }
}
