/* heritage-science header additions, loaded after the project-starter CSS (config/page-layout/html-head.hbs). */

/* Brand: the starter stacks the museum name and the English project line in a column
   (config/page-layout/project-brand-name.hbs). The starter hides the subtitle in the workspace;
   keep the project line visible there too. */
.rs-app-layout--frames .rs-project-brand__subtitle {
  display: block;
}

/* Editor header (data/templates/…SimpleCollectionBrowser.html, edit mode): same layout as the view header,
   thumbnail beside a column of title, type and identification line. */
.resource-record-header--editor .heritage-editor-identity {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 20px;
}

.resource-record-header--editor .heritage-editor-identity .resource-record-header__classification {
  margin: 0 0 2px; /* step 53: the type line is now above the title (.heritage-header-kicker) */
}

.resource-record-header--editor .heritage-editor-identity .text-type-subheader {
  margin: 0 !important;
}

/* Start page (data/templates/…resource%2FStart.html): the platform .homepage-project-summary clips its content
   (overflow hidden, sized for one fixed-header table). The documentation panels are taller, so let the
   left column scroll. */
.heritage-documentation-home .homepage-project-summary {
  overflow-y: auto;
}

/* Start page empty state: let the tab chain grow to the bottom of the panel, so "no saved records" fills the
   remaining height with its icon and text centred. flex 1 0 auto: grows to fill, and taller content (a
   table with rows) still pushes the section to scroll. Only active panes, so hidden panes stay hidden. */
.heritage-documentation-home #heritage-documentation-scope,
.heritage-documentation-home #heritage-documentation-scope > .tab-content,
.heritage-documentation-home #heritage-documentation-scope > .tab-content > .tab-pane.active,
.heritage-documentation-home .rs-secondary-tabs[id$="-types"],
.heritage-documentation-home .rs-secondary-tabs[id$="-types"] > .tab-content,
.heritage-documentation-home .rs-secondary-tabs[id$="-types"] > .tab-content > .tab-pane.active,
.heritage-documentation-home .rs-secondary-tabs[id$="-types"] .semantic-table-holder {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.heritage-documentation-home .rs-secondary-tabs[id$="-types"] .table-no-results {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Start page: space around the row of New buttons in the title header. They wrap onto more lines on narrow
   screens (the platform row does not wrap, which pushed the left column wider than the frame: step 49). */
.heritage-documentation-home .homepage-project-header > .semantic-search-header-actions {
  margin: 12px 0 16px 0;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* The project menu ("The project", starter project-about.hbs): hidden for now
   (user, 2026-11-28). Remove this rule to show it again. Three classes so it
   also beats the starter's narrow-screen panel rule (.rs-project-menu .rs-project-about). */
.rs-project-header .rs-project-menu .rs-project-about {
  display: none;
}

/* Footer: when the ResearchSpace credit is the footer's only item (heritage footer.hbs, about
   and links hidden for now, user 2026-11-28), centre it. Auto margins centre a lone flex item
   on every layout; once the other parts are restored the rule stops matching. */
.rs-project-footer > .rs-project-footer__powered:only-child {
  margin-inline: auto;
}

/* Public Start page (heritage rsp:ProjectHome): space between two stacked rows of columns. */
.heritage-project-home .rs-doc_2columns + .rs-doc_2columns {
  margin-top: 24px;
}

/* Preset search frames (rsp:HeritageRecordsOfType, rsp:HeritageArtworksWithImageType): the one-line
   intro above the search, as a context band (step 42). Theme tokens only: a light tint of the accent
   (--color-action) on the surface, an accent left border, the theme radius, the scale step above body
   text (--rs-font-size-h5, 16px; the element stays a paragraph). Left edge lines up with the search box.
   Undo: restore the previous rule from backups/42_preset_intro_style_before. */
.heritage-preset-intro {
  margin: 12px 20px 4px;
  padding: 8px 12px;
  font-size: var(--rs-font-size-h5, 16px);
  line-height: 1.4;
  color: var(--rs-color-text, var(--color-dark, #242426));
  background: color-mix(in srgb, var(--color-action, #2f64e5) 10%, var(--rs-color-surface, #ffffff));
  border-left: 3px solid var(--color-action, #2f64e5);
  border-radius: var(--border-radius, 1.5px);
}

/* Getting started (heritage rsp:ProjectGuide), step 45: sized from the space the page actually has, so
   it works in a narrow frame on a wide screen. The platform help layout uses viewport gutters
   (minmax(5vw, 15vw), about 238px each at 1590px even inside a narrow frame); this page uses gutters
   based on its own width instead (container query units). Step 49: the content area (up to 1200px) is
   centred in the page or frame; inside it everything is left-aligned on one edge, prose at a reading
   measure (70ch) and the "Exploration starting points" section at the full content width. */
div:has(> .heritage-guide) {
  container-type: inline-size;  /* the frame or page width the guide gets; an element cannot query itself */
}
.page__grid-container.help-page-container.heritage-guide {
  /* centred: equal gutters of at least 3% of the available width (16 to 32px) share the slack, content up
     to 1200px in the middle */
  grid-template-columns: minmax(clamp(16px, 3cqi, 32px), 1fr) minmax(0, 1200px) minmax(clamp(16px, 3cqi, 32px), 1fr);
}
.heritage-guide > .page__content-container > * {
  max-width: 70ch;             /* reading measure for the guide text */
  margin-left: 0;              /* one left edge with the starting points section */
  margin-right: auto;
}
.heritage-guide > .page__content-container > .heritage-guide__wide {
  max-width: none;             /* starting points: full content width, up to 1200px */
}
/* Step 50: the other help guides (heritage overrides of the starter ProjectFramesGuide, ProjectClipboardGuide,
   ProjectAccess, ProjectEditingGuide) are prose only, so the centred column is the reading measure itself. */
.page__grid-container.help-page-container.heritage-guide.heritage-guide--prose {
  grid-template-columns: minmax(clamp(16px, 3cqi, 32px), 1fr) minmax(0, 70ch) minmax(clamp(16px, 3cqi, 32px), 1fr);
}

/* The role groups as columns: as many columns of at least 240px as fit (4 at 1200px, 1 on phones). */
.heritage-starting-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px 32px;
  margin-bottom: 24px;
}
.heritage-starting-points > div {
  min-width: 0;
}
.heritage-starting-points > div > p:first-child {   /* group heading */
  overflow-wrap: break-word;
  margin-bottom: 8px;
}
.heritage-starting-points__list > li {
  margin-bottom: 12px;
}
.heritage-starting-points__meta,
.heritage-starting-points__note {
  display: block;              /* link, then counts, then note, each on its own line */
}
.heritage-nowrap {
  white-space: nowrap;         /* "151 images", "28 artworks": number and noun stay together */
}

/* Header: Workspace and Add Documentation at the left, next to the brand; Search stays at the right
   (user, 2026-11-28). project-nav.hbs splits the nav into .heritage-nav-left and .heritage-nav-right.
   Wide screens: the nav fills the row from the brand on, and the right list is pushed to the end, before
   Help. Menus of the left items open from their toggle's left edge, so they stay on screen. */
@media (min-width: 1281px) {
  .rs-project-header .rs-project-nav {
    flex: 1 1 auto;
    margin-left: 0;
    gap: 24px;
  }
  .rs-project-header .rs-project-nav > .heritage-nav-right {
    margin-left: auto;
  }
  .rs-project-header .heritage-nav-left .dropdown:not(.rs-anchored-dropdown) > .dropdown-menu {
    left: 0;
    right: auto;
  }
}
/* Narrow-screen Menu panel: Search first, then Workspace and Add Documentation, as before the split. */
@media (max-width: 1280px) {
  .rs-project-menu .rs-project-nav > .heritage-nav-right {
    order: -1;
  }
}

/* Step 47 follow-up: artwork drop fields ("Artwork assessed", forms:ConditionAssessment; "Artwork treated", forms:Treatment),
   wrapper div.dragAndDrop-input-container.heritage-artwork-drop. The platform row card is an inline-size container,
   so in the drop zone's wrapping flex row it shrank to its 126px minimum, below the 166px at which it shows its
   thumbnail, and cut type and title to "Art…". As the platform's .form-asset-cards--row (asset sidebar): a grid of
   cards at least 280px wide, each filling its column, the drop prompt across all columns underneath. */
.heritage-artwork-drop .DragAndDropInput--itemArea {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 8px;
  align-items: start;
}
.heritage-artwork-drop .DragAndDropInput--itemArea > div {
  width: 100%;
  min-width: 0;
}
.heritage-artwork-drop .DragAndDropInput--itemArea > .placeholder-item,
.heritage-artwork-drop .DragAndDropInput--itemArea > div:has(.placeholder-item) {
  grid-column: 1 / -1;
}
/* With an artwork present the prompt stays (more can be added: maxOccurs unbound) but drops to one short line. */
.heritage-artwork-drop .DragAndDropInput--itemArea:has(.resource-card) > .placeholder-item {
  min-height: 0;
  padding: 8px;
}
.heritage-artwork-drop .resource-card.resource-card--row {
  --rs-card-thumbnail-size: 64px;
  width: 100%;
}
/* Step 58: on narrow screens (about 400px) the 64px thumbnail left the title only 64px; 48px gives it more room. */
@media (max-width: 767px) {
  .heritage-artwork-drop .resource-card.resource-card--row {
    --rs-card-thumbnail-size: 48px;
  }
}
/* Titles wrap (up to three lines) instead of being cut to one; the type label stays on one line. */
.heritage-artwork-drop .resource-card.resource-card--row .resource-card__footer .resource-card__footer-title,
.heritage-artwork-drop .resource-card.resource-card--row .resource-card__footer .resource-card__footer-title .text-link {
  white-space: normal;
  overflow-wrap: anywhere;
}
.heritage-artwork-drop .resource-card.resource-card--row .resource-card__footer .resource-card__footer-title .text-link {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Step 52: mp-anonymous-hidden and mp-has-permission render Children.only, so each heritage wrapper holds one
   .heritage-signed-in div around its content; display: contents keeps the layout as if the div were not there. */
.heritage-signed-in {
  display: contents;
}

/* Step 53: resource headers (rsp:ResourceHeader, and the editor header in rsp:SimpleCollectionBrowser).
   - The thumbnail shows only when the resource has an image: its fallback is empty, so the box is hidden unless
     an img renders. Records without an image start with the title, without a placeholder icon.
   - The type (editor: resource icon and name; view: the P2_has_type values) is a small line above the title,
     shown once, instead of a second line under it. */
.resource-record-header__thumbnail:not(:has(img)) {
  display: none;
}

.resource-record-header__classification.heritage-header-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  margin: 0 0 2px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--rs-color-text-secondary);
}

.resource-record-header .resource-record-header__classification.heritage-header-kicker .text-type-subheader,
.resource-record-header__classification.heritage-header-kicker .heritage-header-kicker__value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
}

.heritage-header-kicker rs-icon,
.heritage-header-kicker .material-symbols-rounded {
  font-size: 16px;
}

/* Step 53: searches inside a form tab (Image form, Annotations): only the results take the spare height. The
   toolbar otherwise grows (flex 1 1 auto) and leaves large gaps above and below the search field; the platform
   fixes the same thing for .authority-entries in _search.scss. */
.semantic-search-table-container-in-form .search-container > .semantic-search-header-actions {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

/* Step 60: 20px above the "Related media/resources" section (rsp:FormAssetSidebar, in every form). The platform sets
   padding-top: 0 on .form-details-assets-container (forms.scss). */
.form-details-assets-container.form-assets-sidebar {
  padding-top: 20px;
}
