/* === Journal: RIGHT RAIL list/grid (mirrors Brain Dump rail) === */

/* Scope: #rightColumn (Hub’s right-hand column) */
#rightColumn:has(.rc-rail-grid){
  display: block !important;
}

/* Align the chip block with the first section top */
#rightColumn #journalButtons{
  margin-top: 3.25rem !important;
}

/* Header should look like a header, not a pill */
#rightColumn .rail__title{
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 0 0.5rem 0 !important;
}

/* Ensure right-rail rail-grid is actually a grid */
#rightColumn .rc-rail-grid{
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
  row-gap: 0.75rem !important;
  column-gap: 0.75rem !important;
  grid-auto-rows: 8px;
  align-items: start !important;
}

/* Make the chips wrapper “transparent” so its children are grid items */
#journalButtons{
  display: contents !important; /* wrapper disappears; children flow into the grid */
}

/* Each chip = brick (2-up mobile, 3-up lg+) */
#rightColumn .rc-rail-grid #journalButtons > .rail__chip{
  grid-column: span 6 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 0.375rem 0.5rem !important;
  gap: 0.125rem !important;
}
@media (min-width: 992px){
  #rightColumn .rc-rail-grid #journalButtons > .rail__chip{
    grid-column: span 4 !important;
  }
}

/* If an intermediate wrapper exists above the chips, give it spacing */
#rightColumn .rc-rail-grid > :is(div, section, nav, article):has(.hub-btn, .vm-link, .rail__chip){
  display: contents !important; /* let children be grid items */
}

/* Bootstrap btn-group wrapper spacing when used for chips */
#rightColumn .rc-rail-grid > .btn-group:has(.hub-btn, .vm-link, .rail__chip){
  display: contents !important;
}

/* Neutralize Bootstrap btn-group compaction */
#rightColumn .btn-group:has(.hub-btn, .vm-link, .rail__chip){
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
}
#rightColumn .btn-group > .btn:not(:first-child),
#rightColumn .btn-group > .btn-group:not(:first-child){
  margin-left: 0 !important;
}
#rightColumn .btn-group .hub-btn,
#rightColumn .btn-group .vm-link,
#rightColumn .btn-group .btn{
  margin: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: nowrap !important;
}

/* Rail cards width hygiene */
#rightColumn .rc-card{
  width: auto;
  max-width: 100%;
}

/* Unified brick grid for any lists rendered in the right rail */
#rightColumn ul,
#rightColumn .vm-list{
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  padding: 0 !important;
  gap: 0.75rem !important;
  row-gap: 0.75rem !important;
  column-gap: 0.75rem !important;
  align-items: start !important;
  grid-auto-flow: row dense !important;
}

/* Items: 2-up on mobile (span 6), 3-up on lg+ (span 4) */
#rightColumn ul > li,
#rightColumn .vm-list > li{
  list-style: none;
  margin: 0;
  padding: 0;
  grid-column: span 6 !important;
  break-inside: avoid;
}
@media (min-width: 992px){
  #rightColumn ul > li,
  #rightColumn .vm-list > li{
    grid-column: span 4 !important;
  }
}

/* Links/pills inside rail items: never stretch; spacing from grid only */
#rightColumn ul > li > .vm-link,
#rightColumn ul > li > .hub-btn,
#rightColumn .vm-list > li > .vm-link,
#rightColumn .vm-list > li > .hub-btn{
  display: inline-flex !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  justify-self: start !important;
  margin: 0.375rem !important;
}

/* FINAL LOCKS: prevent any stretch inside the right rail */
#rightColumn :is(.journal-pill, .hub-btn, .btn.hub-btn, .btn, .vm-link){
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  justify-self: start !important;
  /* margin comes from grid gap; remove extra external spacing */
  margin: 0 !important;
  box-sizing: border-box !important;
  background: #fff !important;
  border: 1px solid var(--brand-gold, #b08a48) !important;
  border-radius: 0.5rem !important;
  color: #000 !important;
  font-family: var(--bs-body-font-family,"Montserrat",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial) !important;
  font-size: 0.84rem !important;
  line-height: 1.2 !important;
  min-height: 30px !important;
}


/* FINAL WORD: enforce the 0.75rem spacing on any right-rail grid */
#rightColumn :is(.rc-rail-grid, ul, .vm-list){
  row-gap: 0.75rem !important;
  column-gap: 0.75rem !important;
  gap: 0.75rem !important;
}

/* Safety: if a plain list lands without our grid, keep it non-fullwidth */
#rightColumn :is(ol, ul):not(.vm-list){
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
  padding: 0 !important;
  align-items: start !important;
  grid-auto-flow: row dense !important;
}
#rightColumn :is(ol, ul):not(.vm-list) > li{
  list-style: none;
  margin: 0;
  padding: 0;
  grid-column: span 6 !important;
  break-inside: avoid;
}
@media (min-width: 992px){
  #rightColumn :is(ol, ul):not(.vm-list) > li{
    grid-column: span 4 !important;
  }
}
