/* Atlassian products grouped by Collection (home compact cards, /phan-mem/ detailed cards). Tokens only. */

/* Two lead Collections on top, three below; each card opens on its own art (assets/img/atlassian/collections) */
.bp-coll-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* WP block-gap adds a top margin to every child but the first; the grid gap does the spacing */
.bp-coll-grid > * { margin-block: 0 !important; }

.bp-coll {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-outer);
  padding: 0 0 var(--sp-5); display: flex; flex-direction: column; gap: 0; min-width: 0;
  scroll-margin-top: 96px; grid-column: span 2;
}
.bp-coll:nth-child(-n+2) { grid-column: span 3; }
/* One content inset for everything under the art (margin, so the divider above the app rows is inset too).
   Vertical rhythm: art, 24, title, 4, tagline, 16, divider, 16, rows (16 apart), 16, note, link pinned to the bottom. */
.bp-coll > :not(.bp-coll__art) { margin-inline: var(--sp-5) !important; }
.bp-coll .bp-coll__art { margin: 0 !important; border-bottom: 1px solid var(--line-soft); }
.bp-coll > .bp-coll__name { margin-top: var(--sp-5) !important; }
.bp-coll > .bp-coll__tagline { margin-top: var(--sp-1) !important; }
.bp-coll > .bp-coll__note { margin-top: var(--sp-4) !important; }
.bp-coll > .bp-card__link { margin-top: auto !important; padding-top: var(--sp-5); }
.bp-coll__art img { display: block; width: 100%; height: auto; aspect-ratio: 12 / 5; object-fit: cover; border-radius: 15px 15px 0 0; } /* card radius minus its border, no overflow clip on the text */
.bp-section h3.bp-coll__name { font-size: 18px; }
.bp-coll__tagline { font-size: 14px; line-height: 1.45; color: var(--gray-mid); }

/* Compact: app names as neutral chips */
.bp-coll > .bp-coll__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-4) !important; }
.bp-app {
  display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3;
  background: var(--subtle); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
}
.bp-app .bp-appicon { width: 18px; height: 18px; }
.bp-collections--tint .bp-app { background: var(--surface); border: 1px solid var(--line-soft); }

/* Detailed: one row per app, name then its role */
.bp-section ul.bp-coll__apps {
  list-style: none; margin-top: var(--sp-4) !important; padding: var(--sp-4) 0 0; border-top: 1px solid var(--line-soft);
  display: grid; gap: var(--sp-4);
}
.bp-coll__apps li { margin: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: var(--sp-3); row-gap: 2px; font-size: 14px; line-height: 1.4; }
.bp-coll__apps .bp-appicon { grid-row: span 2; width: 28px; height: 28px; margin-top: 2px; }
.bp-coll__apps strong { color: var(--ink); font-weight: 800; font-size: 15px; }
.bp-coll__apps span { color: var(--gray-mid); }
.bp-coll__note { font-size: 13px; line-height: 1.5; color: var(--gray-mid); }
.bp-coll .bp-card__link { font-size: 15px; }

.bp-coll__more { margin-top: var(--sp-6) !important; font-size: 15px; color: var(--gray-mid); }

@media (max-width: 900px) {
  .bp-coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bp-coll, .bp-coll:nth-child(-n+2) { grid-column: auto; }
  /* The odd last card spans the row: art on the left, content on the right, so the art does not grow to full width */
  .bp-coll:last-child:nth-child(odd) {
    grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-content: start; padding: 0;
  }
  .bp-coll:last-child:nth-child(odd) > * { grid-column: 2; }
  .bp-coll:last-child:nth-child(odd) > .bp-coll__art {
    grid-column: 1; grid-row: 1 / span 9; border-bottom: 0; border-right: 1px solid var(--line-soft);
    background: var(--y-pale); border-radius: 15px 0 0 15px; display: flex; align-items: flex-start; /* art bg is #FFF7CC: contain blends below it */
  }
  .bp-coll:last-child:nth-child(odd) .bp-coll__art img { object-fit: contain; border-radius: 0; }
  .bp-coll:last-child:nth-child(odd) > .bp-card__link { margin-top: 0 !important; padding-bottom: var(--sp-5); }
}
@media (max-width: 640px) {
  .bp-coll-grid { grid-template-columns: minmax(0, 1fr); }
  .bp-coll:last-child:nth-child(odd) { display: flex; padding: 0 0 var(--sp-5); }
  .bp-coll:last-child:nth-child(odd) > .bp-coll__art { border-right: 0; border-bottom: 1px solid var(--line-soft); border-radius: 15px 15px 0 0; }
  .bp-coll:last-child:nth-child(odd) .bp-coll__art img { object-fit: cover; border-radius: 15px 15px 0 0; }
  .bp-coll:last-child:nth-child(odd) > .bp-card__link { padding-bottom: 0; }
}
