/* =====================================================================
   Collections page (Archives at NCBS)
   Everything is scoped under .collections-page, so it cannot leak into
   the rest of the site. Wrap the page body in:
     <div class="collections-page"> ... </div>
   ===================================================================== */

.collections-page {
  max-width: 1190px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  color: #222;
  font-family: "Oxygen", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
}

/* ---------- text ---------- */
.collections-page p {
  margin: 0 0 10px;
  line-height: 1.8;
}
.collections-page .rtejustify {
  margin-bottom: 14px;
  line-height: 2;
  text-align: justify;
}
.collections-page h4 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
}
.collections-page a { color: #444; text-decoration: none; }
.collections-page a:hover { text-decoration: underline; }
.collections-page a.read_more { color: #7a3534; }
.collections-page img { max-width: 100%; }

/* ---------- Sample Collections: cards, 2 per row ---------- */
.collections-page .row {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-left: 0;
  margin-right: 0;
  margin-top: 28px;
}
/* neutralise Bootstrap's .row > * rules when a Bootstrap theme is used */
.collections-page .row > * {
  width: auto;
  max-width: none;
  margin-top: 0;
  padding-left: 0;
  padding-right: 0;
}
.collections-page .row > .grid_12 { grid-column: 1 / -1; }

.collections-page .featured_collections {
  background: #fff;
  border: 1px solid #ddd;
  padding-bottom: 8px;
}
.collections-page .featured_collections img {
  display: block;
  width: 100%;
  height: 201px;
  object-fit: cover;
}
.collections-page .featured_collections h5 {
  margin: 14px 15px 8px;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}
.collections-page .featured_collections p {
  margin: 0 15px 6px;
  line-height: 1.8;
}

/* ---------- Other Collections: 4 columns of small cards ---------- */
.collections-page table.views-view-grid,
.collections-page table.views-view-grid tbody {
  display: block;
  width: 100%;
}
.collections-page table.views-view-grid tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, 204px);
  gap: 56px 93px;
  justify-content: start;
  margin-top: 20px;
}
.collections-page table.views-view-grid tr { display: contents; }
.collections-page table.views-view-grid td {
  display: block;
  padding: 0;
  border: 0;
}
.collections-page table.views-view-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.collections-page table.views-view-grid li { margin: 0; padding: 0; }

/* picture: a wide strip, the top of the document is kept */
.collections-page .portfolio-item-wrapper img {
  display: block;
  width: 204px;
  max-width: 100%;
  height: 99px;
  object-fit: cover;
  object-position: top center;
  background: #eee;
}
/* the old markup positioned this box over the picture; keep it in the flow */
.collections-page .cover.boxcaption { position: static; }
.collections-page .project-name h5 {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.collections-page .project-name a { color: #111; }
.collections-page .group.meta { margin: 0; line-height: 1.4; }
.collections-page .group.meta a { font-size: 12px; color: #333; }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  .collections-page .row { grid-template-columns: 1fr; }
  .collections-page table.views-view-grid tbody { gap: 36px 24px; }
}

/* =====================================================================
   Other Collections: even, bordered cards (same look as the search cards)
   Placed last so it overrides the older rules above.
   ===================================================================== */
.collections-page table.views-view-grid tbody {
  grid-template-columns: repeat(auto-fill, 210px);
  gap: 40px 87px;
}
.collections-page table.views-view-grid .views-field { margin: 0; padding: 0; }

/* the card */
.collections-page table.views-view-grid .portfolio-item-wrapper {
  position: relative;
  width: 210px;
  height: 176px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ccc;
}
.collections-page table.views-view-grid .portfolio-item-wrapper:hover,
.collections-page table.views-view-grid .portfolio-item-wrapper:focus-within {
  border-color: #7a3534;
}

/* undo the old positioning inside the card */
.collections-page table.views-view-grid .column.grid_3 {
  position: static !important;
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}
.collections-page table.views-view-grid .column.grid_3 > a { display: none; }

/* picture */
.collections-page table.views-view-grid .portfolio-item-wrapper img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 90px !important;
  margin: 0 !important;
  object-fit: cover;
  object-position: top center;
  background: #eee;
}

/* text under the picture */
.collections-page table.views-view-grid .cover.boxcaption {
  position: static !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  background: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.collections-page table.views-view-grid .project-name,
.collections-page table.views-view-grid .project-text {
  margin: 0 !important;
  padding: 0 !important;
}
.collections-page table.views-view-grid .project-name h5 {
  margin: 0 0 4px !important;
  padding: 0 !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.collections-page table.views-view-grid .group.meta {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}
.collections-page table.views-view-grid .group.meta a {
  font-size: 12px;
  color: #333;
}

/* make the whole card clickable */
.collections-page table.views-view-grid .project-name a::after {
  content: "";
  position: absolute;
  inset: 0;
}