/* Grandliga shared canonical components — single source of truth.
   2.6.21: related-insights only. Contact geometry is intentionally NOT
   overridden globally: Home/Services/Team retain their approved page styles,
   while technical/privacy pages receive a narrowly scoped adapter in technical.css. */

/* ---------- Related legal insights: stable one-card mobile carousel ---------- */
#gl-redesign .gr-related{width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important}
#gl-redesign .gr-related-list{min-width:0!important}
@media (max-width:700px){
  #gl-redesign .gr-related-list,
  #gl-redesign .gr-related-list[data-count]{
    display:grid!important;grid-auto-flow:column!important;grid-template-columns:none!important;
    grid-auto-columns:calc(100% - 42px)!important;gap:12px!important;
    width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
    overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory!important;
    scroll-padding-left:0!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-x:contain!important;
    padding:0 42px 4px 0!important;margin:0!important;scrollbar-width:none!important;
  }
  #gl-redesign .gr-related-list::-webkit-scrollbar{display:none!important}
  #gl-redesign .gr-related-list>.gr-insight{
    width:100%!important;max-width:none!important;min-width:0!important;min-height:250px!important;
    scroll-snap-align:start!important;scroll-snap-stop:always!important;
  }
  #gl-redesign .gr-related-controls{display:flex!important;justify-content:center!important;align-items:center!important;gap:14px!important;margin-top:17px!important}
  #gl-redesign .gr-related-controls[hidden]{display:none!important}
}

/* ===== 2.6.20 related-insights vertical rhythm =====
   Root cause: legacy cards used justify-content:space-between on a column flexbox,
   so the title's vertical position changed with title/category height. Keep every
   card top-aligned and let only the metadata consume the remaining free space. */
#gl-redesign .gr-related-list>.gr-insight{
  justify-content:flex-start!important;
}
#gl-redesign .gr-related-list>.gr-insight h3{
  margin:0!important;
  align-self:stretch!important;
}
#gl-redesign .gr-related-list>.gr-insight .gr-insight-meta{
  margin-top:auto!important;
}
@media (max-width:700px){
  #gl-redesign .gr-related-list>.gr-insight{
    align-items:flex-start!important;
  }
}


/* ===== 2.6.23 related-card geometry = approved Latest Analytics geometry =====
   Do not invent a separate vertical rhythm for Related Legal Insights. Reuse the
   same mobile proportions already approved for Latest Analytics: 20/18/17 card
   padding, 12px taxonomy, 6px underline offset, 19px title, and a compact taxonomy
   slot on desktop. On mobile (2.6.25), let the topic own its natural height
   and use the catalogue's 11px margin after its underline. A fixed slot changes
   that gap whenever the topic wraps and can clip a two-line topic's underline. */
#gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic){
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:42px auto 1fr auto!important;
  row-gap:0!important;
  column-gap:0!important;
  align-items:start!important;
  justify-content:stretch!important;
}
#gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic)>.ga-card-topic{
  grid-row:1!important;
  box-sizing:border-box!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  margin:0!important;
  padding:0!important;
  align-self:start!important;
  overflow:hidden!important;
}
#gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic)>h3{
  grid-row:2!important;
  align-self:start!important;
  margin:0!important;
  padding:0!important;
}
#gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic)>.glrd-meta{
  grid-row:4!important;
  align-self:end!important;
  margin-top:0!important;
}
@media (max-width:700px){
  #gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic){
    min-height:270px!important;
    padding:20px 18px 17px!important;
    grid-template-rows:auto auto 1fr auto!important;
  }
  #gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic)>.ga-card-topic{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin-bottom:11px!important;
    overflow:visible!important;
    font-size:12px!important;
    line-height:1.2!important;
  }
  #gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic)>.ga-card-topic::after{
    margin-top:6px!important;
  }
  #gl-redesign .gr-related-list>.gr-insight:has(>.ga-card-topic)>h3{
    font-size:19px!important;
    line-height:1.3!important;
  }
}

/* 2.6.25: approved Home ends with 46px, measured on the live page.
   Share that value with Services and Privacy; do not alter mobile map endings. */
@media (min-width:701px){
  #gl-redesign{--glrd-contact-end-gap:46px}
  #gl-redesign .glrd-contact-end-space{
    height:var(--glrd-contact-end-gap)!important;
    min-height:var(--glrd-contact-end-gap)!important;
  }
}
